UIGestureRecognizer 在 targetView 外部触摸时取消
我有一个 UIView,我想知道用户何时执行操作:
touchDownInside
(突出显示视图)
touchUpInside
(确认操作)
touchUpOutside
code> (取消并重置突出显示)
什么gestureRecognizer可以为我做这个?
I have a UIView of which I want to know when the user is doing:
touchDownInside
(to highlight the view)
touchUpInside
(to confirm the action)
touchUpOutside
(to cancel and reset the hightlight)
what gestureRecognizer can do this for me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请仔细阅读您的视图也可以重写的四种方法,以处理四种不同的触摸事件:
1)手指触摸屏幕
2)手指在屏幕上移动(当手指移动时会重复此消息。)
3)手指或者手指从屏幕上移开
4) 系统事件,在触摸结束之前中断触摸
Please go though these four methods also which your view can override to handle the four distinct touch events:
1) finger or fingers touches the screen
2)finger or fingers move across the screens(this message repeatedly as a finger moves.)
3)finger or fingers is removed from the screen
4) a system event,interrupts a touch before it ends
您可以通过实现触摸方法本身来做到这一点,为什么需要手势识别器?
上述函数为着陆。
以上功能用于润色。以及两者的组合用于取消。
You can do this implementing the touches methods itself, why do you need gesture recognizer?
The above function for touch down.
The above function for touch up. And the combination of both for cancel.