在 iOS 6 中,我使用以下代码来推送UIImagePickerController
source 类型的UIImagePickerControllerSourceTypeCamera
, 并显示其导航栏。我想显示导航栏,因为在拍摄图像后,我正在推送另一个允许用户在数据库中设置一些属性的 VC。
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
cameraController = [[UIImagePickerController alloc] init];
cameraController.delegate = self;
cameraController.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:cameraController animated:YES completion:NULL];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
cameraController.topViewController.title = @"Add";
cameraController.navigationBar.translucent = NO;
cameraController.navigationBar.barStyle = UIBarStyleDefault;
[cameraController setNavigationBarHidden:NO animated:NO];
}
在 iOS 7 中,此代码不再显示导航栏。有谁知道是否有办法让导航栏恢复UIImagePickerController
源类型UIImagePickerControllerSourceTypeCamera
?