CameraOverlayView 按钮

发布于 2024-09-28 17:58:08 字数 183 浏览 0 评论 0原文

我正在将一个cameraOverlay添加到我的UIImagePickerController中,它显示了所有内容,但它没有注册触摸。我在 viewDidLoad 中初始化了一个按钮,并通过 IB 初始化了一个按钮。

是否有一些规则禁止我将 UIButton 添加到cameraOverlayView 并注册触摸?

谢谢

I'm adding a cameraOverlay to my UIImagePickerController, it shows and all but it doesn't register touches. I init a button in the viewDidLoad and a one via IB.

Is there some rule that prohibits me from adding a UIButton to a cameraOverlayView and register touches?

Thanks

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

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

发布评论

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

评论(1

酒与心事 2024-10-05 17:58:08

我遇到了类似的问题,结果发现我的覆盖 UIView 的框架不够大。 UIView 的 ClipsToBounds 属性默认设置为 NO,这意味着即使子视图位于父级框架之外,它们仍然可见。

因此,本质上,请确保叠加层的框架足够大,或者叠加层的子视图位于其边界内。

I had a similar problem, and it turned out that my overlay UIView's frame was not large enough. The clipsToBounds property for a UIView is by default set to NO, which means its subviews are still visible even if they are outside the parent's frame.

So essentially, make sure your overlay's frame is large enough, or that your subviews of the overlay are positioned within its bounds.

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