同一视图的平移和点击手势识别器,哪个需要失败? [英] Pan and Tap gesture recognizer for same view, which need to fail for the other?

查看:29
本文介绍了同一视图的平移和点击手势识别器,哪个需要失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在同一个视图上检测 Pan 和 Tap,但 Tap 动作也是 pan 的第一个动作,所以我假设 Tap 动作需要 Pan 动作失败,但是它会不会产生任何延迟必须稍等片刻才能知道轻按后是否有平移动作?

I need to detect Pan and Tap on the same view, but the tap action is also the first action for pan, so I assume the Tap action need the Pan action to be failed, but then does it make any delay as it has to wait a little bit in order to know if a tap is followed by a movement for a Pan?

谢谢

推荐答案

点击动作不是平移的第一个动作.点击发生在触摸之后(例如用户抬起手指).平移发生在触摸仍然向下时(例如,手指在屏幕上按下并开始移动).

the tap action is not the first action for a pan. the tap happens after touch up (e.g. the user lifts their finger). the pan happens while the touch is still down (e.g. the finger is pressing on the screen and starts to move).

试试吧,它会工作得很好.

try it, it will work fine.

这篇关于同一视图的平移和点击手势识别器,哪个需要失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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