gpt4 book ai didi

uinavigationcontroller - iOS8中UIImagePickerController隐藏状态栏问题

转载 作者:行者123 更新时间:2023-12-02 06:48:03 25 4
gpt4 key购买 nike

我做到了

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

它在 iOS7 中很棒,但 iOS8 在 View 之间导航栏的转换方面遇到了一些问题,并表示:

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

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

最佳答案

试试这个。

确保您有图像选择器的委托(delegate)。

imagePicker.delegate = self

现在定义这个函数

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

关于uinavigationcontroller - iOS8中UIImagePickerController隐藏状态栏问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25940713/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com