常德赵炯吧 关注:2贴子:16
  • 0回复贴,共1

UIview的旋转动画

只看楼主收藏回复

CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat:angle*M_PI ];//一共转多少2pi为一圈
rotationAnimation.duration = 5.0f;//转多少秒
rotationAnimation.cumulative = YES;
rotationAnimation.delegate = self;
rotationAnimation.fillMode=kCAFillModeForwards;
rotationAnimation.removedOnCompletion = NO;
rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];//轨迹函数,先慢再快再慢
[_zhuanpan.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];


IP属地:湖南1楼2015-12-09 15:07回复