按下 UIView 后面的按钮

发布于 2024-09-28 14:43:28 字数 152 浏览 0 评论 0原文

我有一个按钮,按钮的一半被 UIView 覆盖(用于样式设计)。

我想知道是否有任何方法可以使这个 UIView “触摸透明”,所以如果你按下它,它可以让你选择它后面的图像?

或者我只需要把它变成一个按钮就可以了?

谢谢

汤姆

I have a button and half of the button is covered by a UIView (for styling).

I was wondering if there was any way to make this UIView "touch transparent" as it were, so if you press on it it lets you select the image behind it?

Or will I just have to make it a button itself?

Thanks

Tom

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

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

发布评论

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

评论(2

陌上芳菲 2024-10-05 14:43:28

您应该将 UIView 的 userInteractionEnabled 属性设置为 NO。

You should set the UIView's userInteractionEnabled property to NO.

凉薄对峙 2024-10-05 14:43:28

尝试使 UIView 不透明为 NO

try to make the UIView opaque to NO

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