大佬教程收集整理的这篇文章主要介绍了ios – 从WhiteColor到RedColor的UIButton的背景颜色动画,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
CABasicAnimation *theAnimation; theAnimation=[CABasicAnimation animationWithKeyPath:@"opacity"]; theAnimation.duration=1.0; theAnimation.repeatCount=HUGE_VALF; theAnimation.autoreverses=YES; theAnimation.fromValue=[NSnumber numberWithFloat:1.0]; theAnimation.toValue=[NSnumber numberWithFloat:0.0]; [BigButton.layer addAnimation:theAnimation forKey:@"animateOpacity"];
我们将不胜感激.
谢谢
目标C.
CABasicAnimation *theAnimation=[CABasicAnimation animationWithKeyPath:@"BACkgroundColor"]; theAnimation.duration=1.0; theAnimation.repeatCount=HUGE_VALF; theAnimation.autoreverses=YES; theAnimation.fromValue= [[UIColor redColor] CGColor]; theAnimation.toValue= [[UIColor blueColor] CGColor]; [BigButton.layer addAnimation:theAnimation forKey:@"ColorPulse"];
迅速
let colorAnimation = CABasicAnimation(keyPath: "BACkgroundColor") colorAnimation.fromValue = UIColor.redColor().CGColor colorAnimation.toValue = UIColor.blueColor().CGColor colorAnimation.duration = 1 colorAnimation.autoreverses = true colorAnimation.repeatCount = FLT_MAX self.layer.addAnimation(colorAnimation,forKey: "ColorPulse")
以上是大佬教程为你收集整理的ios – 从WhiteColor到RedColor的UIButton的背景颜色动画全部内容,希望文章能够帮你解决ios – 从WhiteColor到RedColor的UIButton的背景颜色动画所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。