button旋转动画

Posted 十点听风

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了button旋转动画相关的知识,希望对你有一定的参考价值。

旋转动画

 */

-(void)mapBtnAnimation{

    CABasicAnimation* rotationAnimation;

    

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

    

    rotationAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];

    

    rotationAnimation.toValue = [ 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旋转动画的主要内容,如果未能解决你的问题,请参考以下文章

代码创建 WPF 旋转翻转动画(汇总)

在按钮按下时颤动旋转图标并带有动画

应该如何在动画中旋转UIView呢?

旋转图像。动画列表或动画旋转? (安卓)

Android属性动画之旋转动画

如何用js+jquery制作旋转动画?