3

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?

AndrewK
  • 907
  • 8
  • 14
  • Originally asked as a comment under [this post](http://stackoverflow.com/questions/18880364/uiimagepickercontroller-breaks-status-bar-appearance) – AHiggins Sep 19 '14 at 19:03

1 Answers1

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)];
}
Steve Mitcham
  • 5,268
  • 1
  • 28
  • 56
Charith
  • 88
  • 3