首页 > 代码库 > button旋转动画

button旋转动画

旋转动画

 */

-(void)mapBtnAnimation{

    CABasicAnimation* rotationAnimation;

    

    rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform"];

    

    rotationAnimation.fromValue = http://www.mamicode.com/[NSValue valueWithCATransform3D:CATransform3DIdentity];

    

    rotationAnimation.toValue = http://www.mamicode.com/[ NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI, 0.0, 0.0, 1.0) ];

    

    rotationAnimation.duration = 1.0;

    

    rotationAnimation.cumulative = YES;

    

    rotationAnimation.repeatCount = MAXFLOAT;

    

    [self.showMapBtn.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];

    

}

button旋转动画