Does the iPhone 6 Plus automatically hide the status bar in landscape mode?

My current application only supports landscape mode. I present a menu when a user clicks on a panel button element at the top right below the status bar. I recently tested my application in the iPhone 6 Plus simulator, the status bar does not appear in my application, since it only supports landscape mode. In landscape mode, my menu hangs on the left side of the device, and does not stick to the top. Is this due to a lack of condition? I want to show the status bar in the application, as well as fix the menu hanging on the left side. Help me!

+5
source share
2 answers

I added the following lines in the ViewWillAppear method, in which the error in the status bar was fixed.

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

Compiling with the Xcode 6 SDK seems to hide the default status bar in the iPhone landscape.

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

 - (BOOL)prefersStatusBarHidden { return NO; } 
+2
source

Source: https://habr.com/ru/post/1202705/


All Articles