UIImagePickerController在iOS8中隐藏状态栏问题 [英] UIImagePickerController hiding status bar issue in iOS8

查看:293
本文介绍了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:


在意外状态下完成导航过渡。
导航栏子视图树可能已损坏。

Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

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

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中隐藏状态栏问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆