在 iPad 上,当您使用不同于相机源的源时,您会在弹出窗口中显示 UIImagePickerController,您可以根据需要使用它。但是,当您决定选择源时UIImagePickerControllerSourceTypeCamera
,选择器窗口将全屏显示,您有两种情况:
- 如果您使用自定义控件 (showsCameraControls = NO),您可以使用同一个控制器拍摄尽可能多的照片。
- 如果您使用默认控件(showsCameraControls = YES),则在拍摄一张照片后,您必须关闭控制器,因为它再次无法使用,我想这是您的情况。拍摄照片后,您将下一个控制器放入堆栈,之后您尝试返回选择器控制器,但它不再可用,您可以看到黑屏。
苹果文档imagePickerController:didFinishPickingMediaWithInfo:
:
If you set the image picker’s showsCameraControls property to NO and
provide your own custom controls, you can take multiple pictures
before dismissing the image picker interface. However, if you set that
property to YES, your delegate must dismiss the image picker interface
after the user takes one picture or cancels the operation.
If you want to take another picture in this case you have to go back to your base controller and create the UIImagePickerController instance one more.
I hope this will help.
Edit:
The easiest way IMO to rebuild your view controllers stack is to dismiss the picker after taking a photo without animation and after that show the next controller with animation. It will give the user feeling, that the next controller is displayed just after the picker controller without any "flashing".
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[self dismissViewControllerAnimated:NO completion:^{
[self presentViewController:<newController> animated:YES completion:nil];
}];
}