告诉 Superview 忽略触摸事件?

发布于 2024-11-25 11:38:14 字数 83 浏览 1 评论 0原文

我正在向我的超级视图添加一个子视图,我需要知道如何告诉超级视图忽略触摸事件,以便接收触摸事件的唯一视图是子视图。 这将如何完成?

谢谢!

I am adding a subview to my superview and I need to know how to tell the superview to ignore touch events so that the only view receiving touch events, is the subview.
How would this be done?

Thanks!

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

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

发布评论

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

评论(1

还在原地等你 2024-12-02 11:38:14

将超级视图的 userInteractionEnabled 属性设置为 NO:

view.superview.userInteractionEnabled = NO;

Set the userInteractionEnabled property of the superview to NO:

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