标签: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 *)#>//结束动画
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:ios
原文地址:http://blog.csdn.net/u014202635/article/details/47320033