UIImagePickerController在didFinishPickingMediaWithInfo上解雇

时间:2016-04-01 06:41:26

标签: ios objective-c uiimagepickercontroller

来自Apple文档。 “这支持在不离开界面的情况下拍摄多张照片,但需要隐藏默认的图像选择器控件”。

在[self.imagePicker takePicture]上调用委托didFinishPickingMediaWithInfo,但仍然离开界面。 任何想法如何防止控制器被解雇?这是我的UIImagePickerController代码与自定义叠加。

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.showsCameraControls = NO;
CameraOverlayView *overlay = (CameraOverlayView *)[self viewWithNibName:@"CameraOverlayView" owner:self];
overlay.frame = imagePicker.cameraOverlayView.frame;
imagePicker.cameraOverlayView = overlay;
overlay.imagePicker = imagePicker;
[self presentViewController:imagePicker animated:YES completion:nil];
overlay = nil;

3 个答案:

答案 0 :(得分:0)

我遇到同样的问题,但我在代码UzysAssetsPickerController for iOS

中使用这些类解决了这个问题

通过使用此功能,我可以在不关闭图像选择器的情况下选择多个图像。希望这会有所帮助。

答案 1 :(得分:0)

这解决了我的问题。现在工作完美。谢谢大家。

<UIImagePickerControllerDelegate,UINavigationControllerDelegate>
@property(nonatomic,strong) UIImagePickerController *imagePicker;
overlay.imagePicker = _imagePicker;
overlay.imagePicker.delegate = overlay;

答案 2 :(得分:-1)

map