CameraOverlayView按钮 [英] CameraOverlayView buttons
问题描述
我正在向我的UIImagePickerController添加一个cameraOverlay,它会显示,但所有触摸都不会注册。我在viewDidLoad中初始化一个按钮,然后通过IB初始化一个按钮。
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.
是否存在一些规则禁止我将UIButton添加到cameraOverlayView并注册触摸?
Is there some rule that prohibits me from adding a UIButton to a cameraOverlayView and register touches?
谢谢
推荐答案
我遇到了类似的问题,我的叠加层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.
这篇关于CameraOverlayView按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!