Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On iOS8, displaying my app in landscape mode will hide the status bar but on iOS 7 the status bar is displayed on both orientations

I want the status bar to be displayed in both orientations in iOS 8; it's being displayed properly in iOS 7.

navigationController.isNavigationBarHidden returns NO.

Why is iOS 8 doing this?

like image 664
Tim Nuwin Avatar asked Jun 20 '14 14:06

Tim Nuwin


People also ask

How do I hide my status bar on my Iphone?

You can hide just a few icons or all of them for no status bar at all. To do so, open the Settings app, then scroll down and select "HideStatusBarItems." Once inside, the first thing you'll want to do is enable HideStatusBarItem by putting the toggle next to "Enable Tweak" to the on position.

How do I turn off landscape mode in IOS?

Swipe down from the top-right corner of your screen to open Control Center. Tap the Portrait Orientation Lock button to make sure that it's off.


1 Answers

Try this

Add below code in didRotateFromInterfaceOrientation

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

EDIT
NO NEED TO WRITE CODE IN ALL VIEW CONTROLLER
Set View controller-based status bar appearance to NO in plist and add below code in root view controller's viewDidLoad

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone]; 

Demo project
https://www.dropbox.com/s/uumneidk4wom5md/demoStatusBar.zip?dl=0

like image 187
Jageen Avatar answered Sep 23 '22 13:09

Jageen