本文介绍了UIImagePickerController在iOS8中隐藏状态栏问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我这样做了

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
}

在iOS7中很棒,但是iOS8在导航过渡方面遇到了一些麻烦视图之间的栏和说:

and it is great in iOS7, but iOS8 have some trouble with transitions in navigation bar between views and says:

那么,是否有任何已知的解决方案?

So, is any known solution to that?

推荐答案

试试这个。

确保你有一个委托给imagepicker。

Make sure you have a delegate to the imagepicker.

imagePicker.delegate = self

现在定义这个函数

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    [viewController prefersStatusBarHidden];
    [viewController performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}

这篇关于UIImagePickerController在iOS8中隐藏状态栏问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 10:12