iOS动画

作者: 肖旭晖 | 来源:发表于2018-12-20 16:45 被阅读0次

https://blog.csdn.net/zhibudefeng/article/details/8691567/

https://blog.csdn.net/qq_32780047/article/details/51224602

//创建一个关键帧动画
CAKeyframeAnimation *keyAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];

//设置关键帧
keyAnimation.values = @[@(-M_PI_4 * 0.1 * 1), @(M_PI_4 * 0.1 * 1), @(-M_PI_4 * 0.1 * 1)];

//设置重复
keyAnimation.repeatCount = CGFLOAT_MAX;

//把核心动画添加到layer上
[self.imageView.layer addAnimation:keyAnimation forKey:@"keyAnimation"];

[self.button.layer addAnimation:keyAnimation forKey:@"keyAnimation"];

相关文章

网友评论

      本文标题:iOS动画

      本文链接:https://www.haomeiwen.com/subject/aktukqtx.html