大佬教程收集整理的这篇文章主要介绍了ios – 在swift中删除动画,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
文本标签上有重复的动画.创建者:
override func viewDidLoad() { super.viewDidLoad() texTinput.addTarget(self,action: #SELEctor(calculatorViewController.removeAnimation(_:)),forControlEvents: UIControlEvents.TouchDown) self.hintLabel.alpha = 0.0 UIView.animateWithDuration(1.5,delay: 0,options: .Repeat,animations: ({ self.hintLabel.alpha = 1.0 }),completion: nil )
func removeAnimation(textField: UITextField) { view.layer.removeAllAnimations() self.view.layer.removeAllAnimations() print("is it working?!") }
应根据文件工作.
//Just remove the animation from the label. It will Work func remove() { self.hintLabel.layer.removeAllAnimations() self.view.layer.removeAllAnimations() self.view.layoutIfNeeded() }
更新:
如果你想要核,你也可以这样做:
func nukeAllAnimations() { self.view.subviews.forEach({$0.layer.removeAllAnimations()}) self.view.layer.removeAllAnimations() self.view.layoutIfNeeded() }
以上是大佬教程为你收集整理的ios – 在swift中删除动画全部内容,希望文章能够帮你解决ios – 在swift中删除动画所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。