Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Status bar won't disappear

I'm creating an application and I want the status bar hidden. When I test the app, the status bar is hidden whilst the splash screen is shown, but once the app is fully loaded, the status bar reappears.

I'm using Xcode 5 and iOS 7, and have tried disabling the status bar programatically

  ([[UIApplication sharedApplication] setStatusBarHidden:YES           withAnimation:UIStatusBarAnimationFade];), 

in the info.plist file, and using the attributes inspector on the .xib file. Nothing appears to work.

Any ideas?

like image 777
user2397282 Avatar asked Jul 20 '13 15:07

user2397282


People also ask

How can I hide my status bar icon in Android?

How do I hide the status bar on Android? With a stock Android phone, press and hold Settings until System Settings appears. Select System UI Tuner > Status Bar, and turn off all the options.

How do I get rid of status bar on Samsung?

On Android 11-based ONE UI 3.1Scroll down and tap “Advanced settings”. Under the Status bar, tap the “Show notification icons” setting. The default option is the 3 most recent. Select None instead.

Why does the status bar disappear on Android?

You might experience that the status bar on the Home screen of your device disappears. This is caused by a Google™ bug, and may happen if your device fulfils the following: Software version Android™ 7.0 Nougat. Google Now™ is enabled.


2 Answers

Try adding the following method to your app's root view controller:

- (BOOL)prefersStatusBarHidden {     return YES; } 
like image 74
Quentin Avatar answered Oct 10 '22 07:10

Quentin


You should add this value to plist: "View controller-based status bar appearance" and set it to "NO".

This will enable you to set the status bar to hidden mode. This sets it to a global unlike other provided answers.

UPDATE: If you want that the status bar would be hidden on splash screen don't forget to mark "Hide during application launch" on target status bar options. Also, you can add "Status bar is initially hidden" to "YES" on the plist if you don't want to do it with code inside the app.

like image 43
Idan Avatar answered Oct 10 '22 06:10

Idan