难以在 iOS 应用程序中激活 3 触摸手势识别器
我有一个应用程序经常使用手势识别器。从我所做的研究中,我发现有识别手势的touchesBegan方法,然后还有手势识别器,应该更流畅。
我遇到的问题是,手势识别器的响应速度或准确性不如 TouchBegan 方法,但更容易实现,这显然就是我使用它们的原因。如果我想用手势识别器检测到 3 个手指手势,这是相当困难的,因为我必须同时按下我的 3 个手指,否则它不会触发。这与touchesBegan 方法相反,touchesBegan 方法只知道在任何时候有多少根手指按下。
我在实现这个看似不错的手势功能时是否遗漏了一些东西,导致它的响应速度不太快?我已将最大和最小接触次数设置为 3,这不正确吗?
请帮忙。谢谢!!
I have an app that uses gesture recognizers quite a bit. From the studying I have done, I have found that there is the touchesBegan method of recognizing a gesture, and then there are gesture recognizers, which should be more slick.
The problem I am running into is that the gesture recognizers aren't nearly as responsive or accurate as the touchesBegan method, but are a lot easier to implement, which is obviously why I am using them. If I want to have a 3 finger gesture detected with a gesture recognizer, it is quite difficult because I have to press down my 3 fingers at the EXACT same time, or else it won't fire. This is in contrast to the touchesBegan method that just knows how many fingers you have down at any point.
Am I missing something with the implementation of this seemingly nice gesture feature that is making it not very responsive? I have set the max and min touches to 3, is that incorrect?
Please help. Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要同时按下的原因是,默认情况下,一次只能识别一个手势识别器。因此,一旦您按下一根手指,识别器就会自动阻止另外两根手指。
尝试实现 UIGestureRecognizerDelegate 并使用:
我不确定这是否会解决问题,但可能会。
干杯。
The reason you need to press at the exact same time is because, by default, only one gesture recognizer can be recognized at a time. So once you press one finger down that recognizer automatically blocks the other two.
Try implementing the UIGestureRecognizerDelegate and using:
I'm not sure if this will solve the issue or not but it might.
Cheers.