问题描述
如果我将 UILongPressGestureRecognizer
添加到对象,是否有办法在我的 longGesture 选择器响应长按手势后触发该对象中的 touchesMoved
事件而无需先抬起你的手指?
If I add a UILongPressGestureRecognizer
to an object is there a way to get a touchesMoved
event in that object to fire after my longGesture selector responds to the longpress gesture without having to lift your finger first?
我看到的是,一旦选择器识别出长手势,touchesMoved
事件将不会响应,直到您将手指从对象上移开.换句话说,你不能按下、暂停、移动.
What I am seeing is that once the selector recognizes the long gesture the touchesMoved
events will not respond until you remove your finger from the object. In other words you cannot Press, pause, move.
这是否可以通过手势识别器实现,或者唯一的方法是通过点击并按住方法来实现.
Is this even possible with a gesture recognizer or is the only way to do this is with a tap and hold approach.
我希望这是有道理的.
谢谢.
推荐答案
您可以添加 UIPanGestureRecognizer
和 UILongPressGestureRecognizertouchesMoved
方法/code> 到您的视图.
Instead of relying on the touchesMoved
method, you can add UIPanGestureRecognizer
along with UILongPressGestureRecognizer
to your view.
这篇关于UILongPressGestureRecognizer 可以与 touchesMoved 等触摸事件一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!