//创建一个帧动画
CAKeyframeAnimation *anim = [CAKeyframeAnimation animation];
//设置属性
anim.keyPath = @"transform.rotation";
//设置属性值
anim.values = @[@(angle2Rad(-5)) ,@(angle2Rad(5)),@(angle2Rad(-5))];
anim.repeatCount = MAXFLOAT;
anim.duration = 0.25;
[self.imageView.layer addAnimation:anim forKey:nil];
图片抖动.gif
网友评论