Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display status bar on landscape orientation for iOS 8

Currently using XCode6 at the moment. Since this version of XCode only supports iPhone4 and above with OS version (7.0.3 onwards).

I have this application solely designed with a landscape orientation to all of the views in the storyboard. Testing the application using version 7.0.3 was fine, the status bar was still visible. It wasn't the same for version 8.0 wherein the status bar was hidden.

My question is how is it possible to display the status bar on my landscape oriented application that supports version 7.0.3 onwards. Thanks.

like image 620
David B Avatar asked Sep 25 '14 10:09

David B


3 Answers

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

- (BOOL)prefersStatusBarHidden {
    return NO;
}

Also what you can try is when the app goes landscape mode, write below line.

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
like image 54
Fahim Parkar Avatar answered Sep 21 '22 01:09

Fahim Parkar


  1. Make changes to the supported orientation in xcode so that it supports only landscape mode.
  2. Go to info.plist and add an entry and set "View controller-based status bar appearance" = NO
  3. Go to your AppDelegate.m and add[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
like image 28
hariszaman Avatar answered Sep 21 '22 01:09

hariszaman


I'm not sure if this is the right answer. Yet this one works but there's a glitch on iPhone6/iPhone6Plus, it doesn't get displayed upon application start.

[application setStatusBarHidden: NO];
like image 25
David B Avatar answered Sep 19 '22 01:09

David B