1

I see people are having problems with hiding the status bar in iOS 7.1, but I have the opposite problem. I'm unable to unhide once it has been hidden. :)

This piece of the code works perfectly fine on both iOS 7 and 7.1. It will hide the status bar and show the image picker.

if (sourceType == UIImagePickerControllerSourceTypeCamera)
{
    imagePickerController.showsCameraControls = YES;
    if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) {
        [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
    }
}

self.imagePickerController = imagePickerController;
[self presentViewController:imagePickerController animated:YES completion:nil];

However, the part that is supposed to bring the status bar back doesn't work any more in iOS 7.1:

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
[self dismissViewControllerAnimated:YES completion:NULL];

This code will dismiss the image picker, but the status bar will remain hidden.

Any ideas how to solve this issue?

Blob
  • 33
  • 4

1 Answers1

1

OK, I figured something out. The problem doesn't lie in setStatusBarHidden:NO itself, but in its combination with the image picker.

It seems that in iOS 7.1 the image picker (the camera one) will hide the status bar on its own (that wasn't the case in iOS 7.0). So, if I also hide it manually, the status bar is hidden twice and that seems to break something.

To conclude: hiding the status bar manually before showing the camera image picker is pointless in iOS 7.1 because the image picker itself will hide it.

Hiding and showing the status bar without using the image picker works just fine.

Blob
  • 33
  • 4