【问题标题】:imagePickerViewController is not dismissed when an overlay button is pressed按下覆盖按钮时不会关闭 imagePickerViewController
【发布时间】:2014-09-11 16:43:30
【问题描述】:

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

提前致谢!

【问题讨论】:

    标签: ios objective-c uiimageview uiimagepickercontroller presentviewcontroller


    【解决方案1】:

    当您实现自定义覆盖视图时,您有责任关闭 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.

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

    【讨论】:

    • 但是当我按下 overlayView 上的“选择”按钮时,imagePickerController:didFinishPickingMediaWithInfo: 方法会调用吗?因为我所做的只是展示另一个 UIImageController,所以还没有选择任何内容。
    猜你喜欢
    • 2012-12-17
    • 2011-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多