解聘的UIImagePickerController
-
20-09-2019 - |
题
我有以下代码:
SecondViewController *secondView = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
[imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
[imagePicker setCameraOverlayView:secondView.view];
[imagePicker setShowsCameraControls:NO];
[self presentModalViewController:imagePicker animated:YES];
我的问题是:如何从“SecondViewController”
驳回ModalViewController解决方案
您必须调用关于从在imagePicker
一个UIImagePickerControllerDelegate
方法secondView
以下。
例如:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// process message
[imagePicker dismissModalViewControllerAnimated:YES];
}
其他提示
接受的答案不再iOS7工作。下面是一个应该被代替使用的方法。
再次此方法应被调用来自UIImagePicker
的UIImagePickerControllerDelegate
。
-(void) imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[[picker presentingViewController] dismissViewControllerAnimated:YES completion:NULL];
}
不隶属于 StackOverflow