UIImagePickerController hiding status bar issue in iOS8

爷,独闯天下 提交于 2019-12-07 12:43:22

问题


I did this

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

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?


回答1:


Try this.

Make sure you have a delegate to the imagepicker.

imagePicker.delegate = self

now define this function

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


来源:https://stackoverflow.com/questions/25940713/uiimagepickercontroller-hiding-status-bar-issue-in-ios8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!