我有嵌入在 UITabBarController 中的 UIViewController。在我的 PhotoViewController
上,用户可以选择添加照片并调用 UIImagePickerController
。用户选择照片并弹出 View 后,导航栏消失。
显示导航栏。
这是 UIImagePickerController
View ,它看起来好像 CANCEL 按钮位于 NavigationBar
下方。 (在这张照片中很难看到。)
UIImagePickerController
弹出并重新加载 View 后,NavigationBar
消失了。
这是我如何调用 UIImagePickerController
。我继承自 UIImagePickerControllerDelegate
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePickerController.sourceType = sourceType;
imagePickerController.delegate = self;
if (sourceType == UIImagePickerControllerSourceTypeCamera) {
imagePickerController.showsCameraControls = YES;
}
self.imagePickerController = imagePickerController;
[self presentViewController:self.imagePickerController animated:YES completion:nil];
虽然代表说不兼容。
如何纠正问题?
我加了
imagePickerController.modalPresentationStyle = UIModalPresentationFullScreen;
imagePickerController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
这似乎把 imagePickerController 放在了当前 View 的顶部。
关于ios - UIImagePickerController 弹出后 UINavigationBar 消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37999095/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |