如何禁用视图层次结构上的多次触摸?
在我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从你的问题假设你想禁用对视图的多次触摸。为此,只需使用
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.