简体   繁体   English

touchesBegan不适用于UIImageView动画

[英]touchesBegan doesn't work with UIImageView animation

I'm having some issues over here. 我在这里遇到一些问题。 I've got a method called 我有一个方法叫做

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

for a UIImageView , it works fine while the image is static, the touchesBegan method gets called... but when I make the UIImageView animated, touchesBegan stop working. 对于UIImageView ,它在图像静态时可以正常工作,可以调用touchesBegan方法...但是当我将UIImageView动画时, touchesBegan停止工作。 Any ideas of why this happens? 为什么会这样?

In order to receive touchesBegan during animations you must include the UIViewAnimationOptionAllowUserInteraction animation option when creating your animation. 为了在动画期间接收touchesBegan,在创建动画时必须包含UIViewAnimationOptionAllowUserInteraction动画选项。 There is a good discussion here about it. 这是一个很好的讨论在这里了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM