Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide statusbar during splash screen

I'm trying to hide the statusbar during splash screen, which works fine when i add "Status bar is initially hidden" to plist and set value to YES, however this remove the statusBar from the enitre application, even though i've added "View controller-based status bar appearance" to plist and set value to NO and added following to appdelegate:

 UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent  

How can i remove the statusBar initially without removing it in the rest of the application?

like image 445
Peter Pik Avatar asked Feb 08 '16 22:02

Peter Pik


People also ask

How can I hide my status bar in splash screen?

Hide the Status Bar on Android 4.View decorView = getWindow(). getDecorView(); // Hide the status bar. // status bar is hidden, so hide that too if necessary.

How do I hide status bar in splash screen react native?

to make the StatusBar transparent, use backgroundColor={'transparent'} and translucent={true} options in StatusBar component of RN(React Native) like above.

How do I hide kotlin status bar?

To hide status bar in Android using Kotlin, we can request that the visibility of the status bar or other screen/window decorations be changed by setting window. decorView. systemUiVisibility with View. SYSTEM_UI_FLAG_FULLSCREEN in the Activity Kotlin file.


2 Answers

This is updated for Swift 3 of Xcode 8.3.3

In your Info.plist add the following key:

info.plist

Then in your AppDelegate file add the following in didFinishLaunchingWithOptions section:

func application(_application:UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {        UIApplication.shared.isStatusBarHidden = false       return true  } 

That should sort out your problem.

You can also configure the launch colour in your project Build Settings if this is a problem for you:

buildOptions

Hope that helps!

like image 175
BShimm Avatar answered Sep 28 '22 10:09

BShimm


In Swift 4 In Info.plist add:

Status bar is initially hidden YES

like image 24
Flower Avatar answered Sep 28 '22 09:09

Flower