ORStudios
ORStudios

Reputation: 3233

Removing Status Bar In IOS 8 When Using A UINavigationController

I am trying to remove the status bar from my app when moving between views in a UINavigationController.

I have a UINavigationController that has the status bar removed. I then select an image using UIImagePickerController, I think it is this that is resetting the status bar appearance.

After selecting the UIImage I push another view and present the image, the problem is that the status bar has reappeared.

I have tried a number of approaches including calling prefersstatusbarhidden on both views without without any luck.

Any ideas how to remove the status bar?

Thanks

Upvotes: 1

Views: 1644

Answers (2)

Dermot
Dermot

Reputation: 1743

If using iOS8, add

-(BOOL)prefersStatusBarHidden{
    return YES;
}

to your view controller. You will need to add this to each view controller as required.

You could alternatively specify a value for the key View controller-based status bar appearance in info.plist to specify your status bar preferences app-wide.

Upvotes: 1

iPP
iPP

Reputation: 449

Try hiding the status bar manually using this [[UIApplication sharedApplication] setStatusBarHidden:YES];

Upvotes: 0

Related Questions