gpt4 book ai didi

ios - 有什么方法可以在 iOS 7 中为 UIImagePickerController、源类型 UIImagePickerControllerSourceTypeCamera 显示导航栏?

转载 作者:可可西里 更新时间:2023-11-01 04:25:57 26 4
gpt4 key购买 nike

在 iOS 6 中,我使用以下代码推送源类型为 UIImagePickerControllerSourceTypeCameraUIImagePickerController,并显示其导航栏。我想显示导航栏,因为在拍摄图像后,我正在推送另一个允许用户在数据库中设置一些属性的 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 中,这段代码不再显示导航栏。有谁知道是否有办法为源类型为 UIImagePickerControllerSourceTypeCameraUIImagePickerController 取回导航栏?

最佳答案

你猜怎么着?当 imagePicker 呈现时,它会自动设置为隐藏....
您需要做的就是在下一个运行循环中设置隐藏:否。喜欢:

[self presentModalViewController:imagePicker animated:YES];
[self performSelector:@selector(showNavigationBar:) withObject:imagePicker afterDelay:0];

- (void)showNavigationBar:(UIImagePickerController*)imagePicker {
[imagePicker setNavigationBarHidden:NO];
}

关于ios - 有什么方法可以在 iOS 7 中为 UIImagePickerController、源类型 UIImagePickerControllerSourceTypeCamera 显示导航栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19276932/

26 4 0