如何设置 UITapGestureRecognizer 的超时阈值?
我在 iPad 应用中使用 UITapGestureRecognizer
,我想更改它解释为对于点击来说足够短的持续时间。我希望无论我按住手指多久,手指向上时都能识别出我的点击。我怎样才能实现这个目标?
I'm using a UITapGestureRecognizer
in my iPad app and I want to change the duration it interprets as being short enough for a tap. I want my tap to be recognised on finger-up however long I hold down my finger. How can I achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不相信您可以按照您想要的方式覆盖手势持续时间。但是您可以使用 UILongPressGestureRecognizer,这正是你所需要的。
I don't believe you can override the gesture duration the way you want to. However you can use UILongPressGestureRecognizer, which does exactly what you seem to need.