View 做旋转动画

CABasicAnimation* rotationAnimation;

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

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

rotationAnimation.duration = 0.8;

rotationAnimation.cumulative = YES;

rotationAnimation.repeatCount = 10000;

[hud.customView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];


//移除

[hud.customView.layer removeAnimationForKey:@"rotationAnimation"];

你可能感兴趣的:(View 做旋转动画)