码迷,mamicode.com
首页 > 其他好文 > 详细

UIImageView旋转动画

时间:2015-08-06 18:25:53      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:ios

  _loadingView = [[UIImageView alloc]initWithFrame:CGRectMake(150, 300, 50, 50)];

    _loadingView.image = [UIImage imageNamed:@"22"];

    [self.view addSubview:_loadingView];

    CABasicAnimation* rotationAnimation;

    rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];

    rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];

    rotationAnimation.duration = 0.2;

    rotationAnimation.cumulative = YES;

    rotationAnimation.repeatCount = 100000;

    

    [_loadingView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];//开始动画

    _loadingView.layer removeAnimationForKey:<#(NSString *)#>//结束动画

版权声明:本文为博主原创文章,未经博主允许不得转载。

UIImageView旋转动画

标签:ios

原文地址:http://blog.csdn.net/u014202635/article/details/47320033

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!