我有一个 UIButton 子类,我在 IB 中设置了图像,奇怪的是,大约 1/3 的按钮不会响应触摸!发生了什么事?

发布于 2024-11-16 15:30:15 字数 217 浏览 4 评论 0原文

如上所述,我有一个 UIButton 子类,我正在 IB 中设计它。我已将按钮子类设置为 UIView,并将图像设置为按钮。我在图像下方设置了一个 UILabel,试图赋予它 Finder 的外观。一切都很好,除了图像的右侧 1/3 对触摸没有响应!

这是最奇怪的事情。按钮边界设置为封装整个图像,但右侧 1/3 不会响应。

有人见过这个吗?有人知道发生了什么事吗?

谢谢

As described, I have a UIButton subclass, that I am designing in IB. I have set the button subclass to a UIView, and set an image to the button as well. I have set a UILabel beneath the image, attempting to give it the Finder look. Everything works great, except for the fact that the right 1/3rd of the image won't respond to touch!

It is the strangest thing. The button bounds are set to encapsulate the entire image, but that right 1/3rd won'r respond.

Has anyone seen this before? Does anybody know what's going on?

Thanks

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文