Pradeep Rajkumar
Pradeep Rajkumar

Reputation: 937

iPhone 6 Plus auto hides the status bar in landscape mode?

My current application supports only landscape mode. I'm presenting the menu when the user hits the bar button item on the top part right under the status bar. Recently, I checked my application in iPhone 6 Plus simulator, status bar is not shown in my application as it supports only landscape mode. In landscape mode, my menu is hanging on the left side of the device instead of sticking to the top. Is this happening because of the status bar missing ? I want to show the status bar in the application as well as fix the menu hanging on the left side. Help me out!

Upvotes: 5

Views: 4947

Answers (2)

Pradeep Rajkumar
Pradeep Rajkumar

Reputation: 937

I added the following lines in the ViewWillAppear method which fixed the Status bar missing issue.

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
[self setNeedsStatusBarAppearanceUpdate];

Upvotes: 3

Mike Kwan
Mike Kwan

Reputation: 24447

Compiling with the Xcode 6 SDK appears to hide the status bar by default on iPhone landscape.

You can get the status bar back by setting View controller-based status bar appearance to YES in your Info.plist and then adding the following code to your UIViewController:

- (BOOL)prefersStatusBarHidden
{
    return NO;
}

Upvotes: 2

Related Questions