I have a ViewController which is the 1st to be loaded and I don't use the NavigationController to navigate to the next VC. I use Segue.
I have a background image which covers the entire screen for this 1st VC. It covers the status bar for Carrier/Time/Battery and the color turn black. User will not able to see the battery life.
There is no view controller-based status bar property in my project info.plist file(In setting it to NO)
What do I need to do to set the color white or another color to make the staus bar visible?
override func viewWillAppear() {
super.viewWillAppear()
var nav = self.navigationController?.navigationBar
nav?.barStyle = UIBarStyle.Black
nav?.tintColor = UIColor.whiteColor()
nav?.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.orangeColor()]
}
You can override
the preferredStatusBarStyle
to .lightContent
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With