Display status bar in landscape orientation for iOS 8

Currently using Xcode6. Since this version of Xcode only supports iPhone4 and higher with OS version (7.0.3 and later).

I have this application developed exclusively with a landscape orientation to all the representations in the storyboard. Testing the application using version 7.0.3 was great, the status bar was still visible. This was not the same for version 8.0, in which the status bar was hidden.

My question is how can I display the status bar in my landscape-oriented application that supports version 7.0.3 and later. Thanks.

+6
source share
4 answers

I am not sure if this is the correct answer. However, this works, but there is a glitch on the iPhone6 ​​/ iPhone6Plus, it does not appear when the application starts.

[application setStatusBarHidden: NO]; 
+2
source

To display the status bar in landscape mode in ios 8, try the following method.

 - (BOOL)prefersStatusBarHidden { return NO; } 

You can also try when the application goes into landscape mode, write below the line.

 [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone]; 
+14
source
  • Make changes to the supported orientation in xcode so that it only supports landscape mode.
  • Go to info.plist and add an entry and set "View status bar based on controller" = NO
  • Go to AppDelegate.m and add [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
+9
source

From what I can say, if Apple does not introduce a new API that I have not found ... The status bar is always hidden when the device’s vertical-size class is compact.

I haven't found a way yet, but I don't think there is a way around this. All system applications do the same.

Although, if you compile your application against the iOS 7.1 SDK, you can still save the status bar in the landscape, but this is not very useful if you want to use the new APIs, etc.

Edit:

Perhaps I’m mistaken, the native Twitter application saves the status bar when viewing a web page in the landscape ... Not sure how to do it, though ...

0
source

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


All Articles