简体   繁体   English

iPhone:禁用App的多点触控

[英]iPhone: disable multi touch for App

I want to disable multi-touch for whole app in general. 我想禁用整个应用程序的多点触控功能。 Is there any property self.disableMultiTouchForAllScreens = YES ? 是否有任何属性self.disableMultiTouchForAllScreens = YES I have a lot of screens, and I dont want to disable multi touch for each of them separately. 我有很多屏幕,并且我不想分别为每个屏幕禁用多点触摸。

Suggestion by SimpleMan is good, why you bother about disabling just don' implement. SimpleMan的建议很好,为什么您不愿意禁用禁用功能。

If you still want to do it by some reason, then might be you can do following- you can create a subclass of uiviewcontroller, something like MyViewController : UIViewController 如果您仍然出于某种原因想要这样做,则可以执行以下操作-您可以创建uiviewcontroller的子类,类似于MyViewController:UIViewController

In the implementation of MyViewController, you can disable multi touch. 在MyViewController的实现中,可以禁用多点触控。 Now all other view controller of your class need to implement MyViewController instead of uiviewcontroller. 现在,您的类的所有其他视图控制器都需要实现MyViewController而不是uiviewcontroller。

@Jim: @Jim:

I don't think it is possible as it just refers to views. 我不认为这是可能的,因为它仅指观点。

Refer to this StackOverflow post: 请参阅此StackOverflow帖子:

iPhone - Disable multiple touch in whole application iPhone-在整个应用程序中禁用多点触摸

Here is answer from user malinois in that post" 这是该帖子中来自malinois用户的答案”

Looking Apple documentation, I think that is not possible because touch event delivery refers only on views : Regulating Touch Event Delivery 查看Apple文档,我认为这是不可能的,因为触摸事件传递仅取决于视图: 规范触摸事件传递

I am afraid that if you want to disable it. 恐怕要禁用它。 You will have to do it individually. 您将必须单独进行。

One Suggestion: (This is just a suggestion and may be easier to achieve) 一个建议:(这只是一个建议,可能更容易实现)

I am not sure but may be you can subclass the controls you use in your app and make multitouch disabled by default in the subclass itself. 我不确定,但也许可以将您在应用程序中使用的控件子类化,并在子类本身中默认情况下禁用多点触摸。 Then you can use those classes as base classes of your controls and make it work. 然后,您可以将这些类用作控件的基类并使其起作用。

Hope this helps you 希望这对你有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM