首页 > 代码库 > iOS 小动画

iOS 小动画

  一。图片旋转

  CABasicAnimation* rotationAnimation;

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

        rotationAnimation.toValue = http://www.mamicode.com/[NSNumber numberWithFloat: M_PI * 2.0 ];

        rotationAnimation.duration = 1;

        rotationAnimation.cumulative = YES;

        rotationAnimation.repeatCount = 0;

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