如何处理 iPhone 上的单点触摸和双点触摸
我想做一些类似于 iPhone 的照片查看器的东西。单击时,UI 栏会在短暂延迟后消失。当您双击时,它会放大。但我不希望双击时发生任何事情,因为我还没有实现放大。
有人知道如何做到这一点吗?
[这篇文章]并没有真正帮助。除非你告诉我有必要子类化UIGestureRecognizer
。然后,我想我可以弄清楚。有人有例子吗?
I want to do something similar to iPhone's photo viewer. When you single tap, the UI bars disappear after a short delay. When you double tap, it zooms in. But I don't want anything to happen on double tap because I haven't yet implemented zooming in.
Anyone know how to do this?
[This post] didn't really help. Unless you tell me it's necessary to subclass UIGestureRecognizer
. Then, I think I could figure it out. Anyone have any examples?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看
UITapGestureRecognizer
文档。您需要查看两个属性:numberOfTapsRequired
;和numberOfTouchesRequired
Look at the
UITapGestureRecognizer
documentation. There's two properties you want to look at:numberOfTapsRequired
; andnumberOfTouchesRequired
查看 Three20 的 PhotoView。它会做你想要做的事情。
Check out Three20's PhotoView. It does what you're looking to do.
下面是一些应该有帮助的代码:
Here's some code that should help: