如何禁用视图层次结构上的多次触摸?

发布于 2025-01-06 09:59:31 字数 420 浏览 1 评论 0原文

在我的 iPad 应用程序中..

开发拖放操作..

在模拟器中一切正常,因为在模拟器中只需触摸一下鼠标指针...

但在设备中,由于多次触摸,一切都会卡住...

在我的iPad应用程序中,

View contains scrollview and scroll view contaains cells...
I have done 
user interaction disabled
on touches began

and 
user interaction Enabled
on touches Ended 

虽然它允许触摸..

我还为所有视图做了禁用多点触摸

请帮助我被卡住了....

In my iPad app..

Developing dragging and dropping..

Everything works fine in simulator as in simulator there is only one touch of mouse pointer...

But in device everything gets stucked because of multiple touches...

In my iPad app,

View contains scrollview and scroll view contaains cells...
I have done 
user interaction disabled
on touches began

and 
user interaction Enabled
on touches Ended 

Though it allows touches..

I have also done multiple touch disabled for all views

Please help I am stucked....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烂柯人 2025-01-13 09:59:31

我从你的问题假设你想禁用对视图的多次触摸。为此,只需使用 multipleTouchEnabled 属性,如下所示:self.view.multipleTouchEnabled = NO。不要忘记遍历所有视图和子视图来设置此属性。

下次,也许可以看看 Apple 自己的文档,因为它非常好,并且 multipleTouchEnabled bool 是所有 UIView 子类的标准配置。

I'm assuming from your question you want to disable multiple touches on your views. To do this, just use the multipleTouchEnabled property, like so: self.view.multipleTouchEnabled = NO. Don't forget to iterate through all your views and sub-views to set this property.

Next time, maybe take a look at Apple's own documentation, because it's quite good and the multipleTouchEnabled bool is standard across all UIView subclasses.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文