中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

iOS實現旋轉

2018-07-20    來源:open-open

容器云強勢上線!快速搭建集群,上萬Linux鏡像隨意使用
#import "ViewController.h"
 
@interface ViewController ()
@property (strong, nonatomic)UILabel *label;
@end
 
@implementation ViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    CGRect labelFrame = CGRectMake(100, 100,100, 50);
    self.label = [[UILabel alloc] initWithFrame:labelFrame];
    self.label.font = [UIFont fontWithName:@"Helvetica" size:36];
    self.label.text = @"XxxX";
    self.label.textAlignment = NSTextAlignmentCenter;
    self.label.backgroundColor = [UIColor brownColor];
    [self.view addSubview:self.label];
    [self rotateLabelDown];
}
 
- (void)rotateLabelDown{
    [UIView animateWithDuration:10 animations:^{
        self.label.layer.anchorPoint = CGPointMake(0.5, 0.5);
        //self.label.transform = CGAffineTransformMakeRotation(-90);  //逆時針旋轉
        self.label.transform = CGAffineTransformMakeRotation(M_PI);
    } completion:^(BOOL finished) {
        [self rotateLabelUp];
    }];
}
 
- (void)rotateLabelUp{
    [UIView animateWithDuration:10 animations:^{
        self.label.layer.anchorPoint = CGPointMake(0.5, 0.5);
        self.label.transform = CGAffineTransformMakeRotation(0);
    } completion:^(BOOL finished) {
        [self rotateLabelDown];
    }];
}
 
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
 
@end

標簽: isp

版權申明:本站文章部分自網絡,如有侵權,請聯系:west999com@outlook.com
特別注意:本站所有轉載文章言論不代表本站觀點!
本站所提供的圖片等素材,版權歸原作者所有,如需使用,請與原作者聯系。

上一篇:python讀寫dbf文件

下一篇:Python ftp client 處理含有中文的文件名