仅在超级视图上禁用触摸事件?
我的屏幕上有一个从 XIB 加载的子视图,我需要仅在其超级视图上禁用触摸事件,同时最终不触摸子视图。我该怎么做? 另外,我正在使用 iOS。
谢谢!
I have a subview on the screen that is loaded from a XIB, I need to disable touch events ONLY on its superview while not touching the subview in the end. How would I do this?
Also, I am using iOS.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这就是您可以执行此操作的方法 -
This is how you can go about doing this -
我也是 iPhone 开发新手,但是当我尝试仅移动 UIImage 视图时,这段代码帮助了我。
如果您在视图中使用按钮或标签,则可以对此代码应用更改。
I am also new to iphone development but htis piece of code helped me out when i tried to move only UIImage view.
you can apply cahnges on this code if you are using buttons or labels in your view.
在 XIB 中,您可以只使用同一级别的超级视图并将其 usertouch 界面设置为 FALSE,而不是使用所有其他视图作为子视图。
In XIB, rather than using all other views as subview, u can just use superview at same level and set its usertouch interface as FALSE.