Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Status bar not showing up on iOS app

I am having a problem getting the status bar to show up in my view on iOS. I have tried changing the plist file of "Status Bar is Initially Hidden" to NO but it still doesn't show up.This black bar is all I get and I am unsure why. enter image description here

EDIT: I am unsure why i got down voted, I did research this and everything I've tried has not worked, maybe i should be more specific. Ive tried both the answers below, resulting in an error. Is there something i am missing with delegation or something similar. I am new to swift and have issues with delegations.

like image 626
Dallas Avatar asked Jan 16 '16 09:01

Dallas


2 Answers

One other thing you can try is to click on the name of your project. Then click on the name of your project under Targets. Then under where it says Deployment Info take a look at where it says Status Bar Style and change it to Light. Do a Shift+Cmd+K to clean and then run.

like image 142
jasonnoahchoi Avatar answered Nov 16 '22 01:11

jasonnoahchoi


The perfect and working way to make StatusBar LightContent.

1) Go to "info.plist" and add property View controller-based status bar appearance = NO

2) In your AppDelgate.swift, put this code:

application.setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)

Hope this helps!

UPDATE : for iOS 9, Swift 4 :

UIApplication.shared.statusBarStyle = .lightContent
like image 2
Sohil R. Memon Avatar answered Nov 16 '22 00:11

Sohil R. Memon