UIImagePickerController:自定义相机叠加坐在默认控件的顶部? [英] UIImagePickerController: Custom camera overlay sitting on top of default controls?
问题描述
我正在使用 UIImagePickerController cameraOverlayView
属性创建自定义摄像头UI。但是,我想保留一些现有的UI - 特别是顶部的闪光灯和相机选择按钮。
我的想法是我会保留 showsCameraControls = YES
设置 cameraOverlayView
到我的自定义UI,然后使用
[picker.view bringSubviewToFront:overlayView]
以确保底部的控件位于默认控件的顶部。
唉,这不行。我试着将覆盖层移动到视图层次结构的前面,在各种地方没有运气。 有没有任何 UIImagePickerController
hackery可以解决这个问题?似乎很遗憾,不能重复使用至少一些相机控件,同时仍然自定义
进一步调查显示这是不可能的。您必须使用所有默认的isara UI或不使用它。
I'm creating a custom camera UI using UIImagePickerController cameraOverlayView
property. However, I'd like to keep some of the existing UI -- specifically the flash and camera selection buttons at the top.
My thought was that I'd keep showsCameraControls = YES
set the cameraOverlayView
to my custom UI and then use [picker.view bringSubviewToFront:overlayView]
to make sure my controls on the bottom are sitting on top of the default controls.
Alas, this does not work. I've tried moving the overlay to the front of the view hierarchy in various places without luck. Is there any UIImagePickerController
hackery that could achive this? It seems a shame not to be able to reuse at least some of the camera controls while still customizing the UI.
Further investigation it appears this is not possible. You either have to use all of the default cameara UI or none of it.
这篇关于UIImagePickerController:自定义相机叠加坐在默认控件的顶部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!