【发布时间】:2013-08-05 00:06:57
【问题描述】:
这在 iOS6 中有效,所以不确定是什么问题。
在我的 UINavigationController (ioNavController) 中,我向 UIImagePickerController 展示了以下内容:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.modalInPopover = YES;
imagePicker.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentViewController:imagePicker animated:NO completion:^{ }];
在我的 UIImagePickerControllerDelegate(确实被调用)中,我有以下内容:
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
//This does not work
[ioNavController dismissViewControllerAnimated:YES completion:^{ /* Cleanup if Needed */ }];
//This does not work
[[picker parentViewController] dismissViewControllerAnimated:YES completion:^{ /* Cleanup if Needed */ }];
//This does not work
[picker removeFromParentViewController];
// This presents a new view on the Nav Controller. It shows the new view ontop of the ImagePicker. Image Picker View does not repond to touches.
[ioNavController pageToSelect:0];
}
【问题讨论】:
-
你登录过 ioNavController 看看它是否为 nil 吗?另外,当你展示一个视图控制器时,你应该使用 self.presentingViewController 访问它,而不是 parentViewController。
-
你尝试过什么吗?请给一些反馈
标签: ios uinavigationcontroller uiimagepickercontroller uipopovercontroller