动画加载 360度旋转

2016-11-07  本文已影响13人  每天刷两次牙

/**核心代码 */

CABasicAnimation* rotationAnimation;

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

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

rotationAnimation.duration = duration;

rotationAnimation.cumulative = YES;

rotationAnimation.repeatCount = repeat;

[_loadingView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];

上一篇下一篇

猜你喜欢

热点阅读