CAAnimation - 用户输入禁用 [英] CAAnimation - User Input Disabled

查看:99
本文介绍了CAAnimation - 用户输入禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图动画按钮。当我这样做(使用button.layer addAnimation)按钮被禁用。有没有什么办法可以让用户交互的动画是什么时候?我也尝试使用animateWithDuration传入选项UIViewAnimationOptionAllowUserInteraction在一个块包装的一切,但它仍然无法正常工作。

I am trying to animate a button. When I do so (using button.layer addAnimation) the button becomes disabled. Is there any way to allow user interaction when animating? I also tried wrapping everything in a block using animateWithDuration passing in the option UIViewAnimationOptionAllowUserInteraction, but it still doesn't work.

编辑:很奇怪。如果我在右上角点击(这里我把我的按钮),它触发了该事件。这几乎就像按钮的边框不遵循动画。

It's odd. If I click in the upper corner (where I placed my button) it fires off the event. It's almost like the frame of the button does not follow the animation.

编辑:我落得这样做是创造每0.1秒设置button.frame等于[button.layer presentationLayer]帧]触发一个事件。这似乎这样的伎俩。

What I ended up doing is create an event that fires every 0.1 seconds that sets the button.frame equal to the [[button.layer presentationLayer] frame]. That seemed to do the trick.

推荐答案

我最终什么事做的是创造每0.1秒设置button.frame等于button.layer触发一个事件

What I ended up doing is create an event that fires every 0.1 seconds that sets the button.frame equal to the button.layer

这篇关于CAAnimation - 用户输入禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆