iPhone - 跟踪三点触摸
假设您在 iPhone 屏幕上有三个接触点,并且其中一个触摸点发生了移动……
将调用 TouchesMoved 方法,并且 [[event TouchesForView:self] count] 将等于“3”,因为有 3 次触摸事件,但是如何区分触摸呢?例如,找出移动的是第一次、第二次还是第三次触摸?
谢谢。
Suppose you have three points of contact on the iPhone screen and one of those touches moves...
The touchesMoved method will be invoked and the [[event touchesForView:self] count] will be equal to '3' because there are three touches for the event, but how can you distinguish between the touches? For example - find out whether it was the first, second, or third touch which moved?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
touchesMoved:withEvent: 的 attempts 参数将包含实际移动的触摸。在touchesBegan:withEvent:中,你可以将它们存储起来;在整个触摸序列中,实际的触摸对象将保持相同(即,相同的对象,尽管它们的值会改变)。
the touches argument of touchesMoved:withEvent: will contain the actual touches that moved. In touchesBegan:withEvent:, you can store those away; the actual touch objects will remain the same (ie, same objects, although their values will change) throughout the entire touch sequence.