如何识别点击手势而视图动画 [英] How to recognize tap gesture while a view is animating

查看:140
本文介绍了如何识别点击手势而视图动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道有没有办法有一个观点认点击手势而被动画呢?我的工作有拴它cashapelayer线视图。当用户平移视图(平移手势),该行遵循相应地,直到用户停止平移。在这点上,执行一个动画带来视图回到其原始位置和系绳层背面为好。现在我唯一真正的问题是,虽然视图和系绳的动画视图犯规响应挖掘手势...

Just wondering is there way to have a view recognize tap gestures while it is being animated? I am working on a view that has a cashapelayer line tethered to it. When the user pans the view (pan gesture) the line follows accordingly until the user stops panning. At this point an animation is executed that brings the view back to its original position and the tether layer back as well. Now my only real problem is that while the view and the tether are animating the view doesnt respond to tap gestures…

任何人都知道一些技巧?我希望我的解释是事先理解和感谢!

Anyone know some tricks? I hope my explanation was understandable and thanks in advance!

(如果拴视图概念不清楚有一个免费的应用程序称为discovr应用,这将给一个例子)。

(if the tethered view concept is not clear there is a free app called discovr apps which will give an example).

推荐答案

我假设你使用的是 [UIView的animateWithDuration:延迟:选项:动画:完成:] 动画的方法。

I'm assuming that you are using the [UIView animateWithDuration: delay: options: animations: completion:]; method of animating.

如果是这样,你需要通过 UIViewAnimationOptionAllowUserInteraction 作为一个选项,以获得动画视图,同时它以动画触摸做出响应。

If so, you need to pass UIViewAnimationOptionAllowUserInteraction as an option to get the animated view to respond to touches while it is animating.

这篇关于如何识别点击手势而视图动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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