Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding the Status Bar for an iPhone app running on iPad

My iPhone app requires that the status bar be hidden at all times. This is generally easy to do, and it works if I only run the app on an iPhone. However, if I run the app on an iPad, the status bar still appears at the top of the content. So, how do I make sure the status bar is hidden no matter device my iPhone-only app is running on? I'm currently doing the following in my code:

Calling this method for each view controller(I actually created a category on UIViewController that implements this automatically for any VC, but it's basically the same as writing it in each vc file):

-(BOOL)prefersStatusBarHidden{
    return YES;
}

I also set "status bar is initially hidden" to YES and "View controller-based status bar appearance" to NO in Info.plist. I've also tried detecting which device is being used and calling

[UIApplication sharedApplication]setSetStatusBarHidden:YES]

in the AppDelegate, but no luck there either. So, I believe I've tried just about everything that one would think to try.

like image 449
mike Avatar asked Jan 10 '14 02:01

mike


1 Answers

It seems this was introduced into iOS 7.1 and affects non-retina iPads running iPhone applications with retina graphics.

No solution for developers. I think Apple will have to patch this one...

Problem devices: iPad 2 iPad Mini (non-retina).

Problem does not exist in iOS 7.0 and status bar issues can be fixed for 7.0 with the other solutions posted.

Update for September 2014 - iOS 8:

This bug is fixed for iOS 8!!!!!

like image 57
Danoli3 Avatar answered Sep 23 '22 17:09

Danoli3