按下覆盖按钮时,不会关闭imagePickerViewController

时间:2014-09-11 16:43:30

标签: ios objective-c uiimageview uiimagepickercontroller presentviewcontroller

我已经实现了一个带有按钮的自定义相机overlayView,可以使用带有xib文件的UIViewController类来访问photoLibrary。叠加成功加载,按钮工作正常。但是,当photoLibrary打开时,相机仍在后台打开。看起来photoLibrary View只是覆盖了相机视图,我甚至可以点击“拍摄”按钮所在的位置并拍照...有谁知道这里的问题是什么?

提前致谢!

1 个答案:

答案 0 :(得分:0)

实现自定义叠加视图时,您有责任解除UIImagePickerController。这来自UIImagePickerController上的showsCameraControls属性

If you set this property to NO and provide your own custom controls, you can take multiple pictures before dismissing the image picker interface.

您必须从dismissViewControllerAnimated:completion:委托方法调用UIImagePickerController上的imagePickerController:didFinishPickingMediaWithInfo: