CameraOverlayView 按钮
我正在将一个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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了类似的问题,结果发现我的覆盖 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.