[NSTimer scheduledTimerWithTimeInterval: 3。f重复:是的块:^ (NSTimer * _Nonnull计时器){ CABasicAnimation * rotationAnimation=(CABasicAnimation动画);; rotationAnimation=[CABasicAnimation animationWithKeyPath: @“transform.rotation.y”); rotationAnimation。toValue=https://www.yisu.com/zixun/[NSNumber numberWithFloat M_PI * 2.0):; rotationAnimation。时间=1;//切换界面保证动画不停止 rotationAnimation。removedOnCompletion=没有; rotationAnimation。repeatCount=1; [self.bindCardImageView。层addAnimation: rotationAnimation forKey: @“rotationAnimation”); });
CABasicAnimation * waitAnimation=(CABasicAnimation动画); waitAnimation。toValue=https://www.yisu.com/zixun/(NSNumber numberWithFloat: 1.0); waitAnimation。时间=3.度; waitAnimation。beginTime f=3.; CABasicAnimation * rotationAnimation=[CABasicAnimation animationWithKeyPath: @“transform.rotation.y”); rotationAnimation。toValue=https://www.yisu.com/zixun/[NSNumber numberWithFloat M_PI * 2.0):; rotationAnimation。时间=1.度; CAAnimationGroup *组=(CAAnimationGroup动画); 组。时间=4.度; 组。repeatCount=CGFLOAT_MAX; 组。removedOnCompletion=没有; [集团setAnimations: @ [waitAnimation, rotationAnimation]]; [self.bindCardImageView。层addAnimation:集团forKey: @“bindCardImageViewAnimation”);
CABasicAnimation *?[CABasicAnimation animationWithKeyPath: @“transform.rotation.z”);//设置抖动幅度 shake.fromValue=https://www.yisu.com/zixun/(NSNumber numberWithFloat: -0.2); 颤抖。toValue=(NSNumber numberWithFloat: + 0.2); 颤抖。时间=0.1; 颤抖。autoreverses=是的;//是否重复 颤抖。repeatCount=3; [itemView.iconImageView。层addAnimation:抖forKey: @“imageView”); >之前以上这篇iOS动画——定时对UIView进行翻转和抖动的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
iOS动画——定时对UIView进行翻转和抖动的方法