Error[8]: Undefined offset: 4, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我有一个文本字段,用户应该输入信息.以及将用户指向文本字段的标签(如提示). 我想在用户按下文本字段输入数据后停止动画删除提示标签. 文本标签上有重复的动画.创建者: override func viewDidLoad() { super.viewDidLoad() textInput.addTarget(self, action: #selector(CalculatorVi 我有一个文本字段,用户应该输入信息.以及将用户指向文本字段的标签(如提示).

我想在用户按下文本字段输入数据后停止动画并删除提示标签.

文本标签上有重复的动画.创建者:

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?!")}

应根据文件工作.

即使我看到打印在控制台中的字符串,我的标签仍然闪烁.我想问题是动画重复,但不知道如何解决这个问题.

@H_403_19@解决方法
//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({[+++].layer.removeAllAnimations()})    self.vIEw.layer.removeAllAnimations()    self.vIEw.layoutIfNeeded()}
总结

以上是内存溢出为你收集整理的ios – 在swift中删除动画全部内容,希望文章能够帮你解决ios – 在swift中删除动画所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
ios – 在swift中删除动画_app_内存溢出

ios – 在swift中删除动画

ios – 在swift中删除动画,第1张

概述我有一个文本字段,用户应该输入信息.以及将用户指向文本字段的标签(如提示). 我想在用户按下文本字段输入数据后停止动画删除提示标签. 文本标签上有重复的动画.创建者: override func viewDidLoad() { super.viewDidLoad() textInput.addTarget(self, action: #selector(CalculatorVi 我有一个文本字段,用户应该输入信息.以及将用户指向文本字段的标签(如提示).

我想在用户按下文本字段输入数据后停止动画并删除提示标签.

文本标签上有重复的动画.创建者:

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?!")}

应根据文件工作.

即使我看到打印在控制台中的字符串,我的标签仍然闪烁.我想问题是动画重复,但不知道如何解决这个问题.

@H_403_19@解决方法
//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({.layer.removeAllAnimations()})    self.vIEw.layer.removeAllAnimations()    self.vIEw.layoutIfNeeded()}
总结

以上是内存溢出为你收集整理的ios – 在swift中删除动画全部内容,希望文章能够帮你解决ios – 在swift中删除动画所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1103663.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存