Reputation: 63
I've used the following code:
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
It does work on my initial view controller scene, but it does not work on any other ones.
I've put the same function on each viewcontroller's Swift file.
Thanks in advance.
Upvotes: 0
Views: 1444
Reputation: 876
1.Change in info.plist the row View controller-based status bar appearance and set it to NO
2.Change in appDelegate.swift in didFinishLaunchingWithOptions
UIApplication.shared.statusBarStyle = .lightContent
Upvotes: 0
Reputation: 8516
Perform the below changes to keep the status bar of color white.
View controller-based status bar appearance
in info.plist = NoUIApplication.shared.statusBarStyle = .lightContent
Upvotes: 0
Reputation: 2425
You can change the info.plist the row View controller-based status bar appearance
and set it to NO
Then put this line of code in your appDelegate.swift
in didFinishLaunchingWithOptions
UIApplication.shared.statusBarStyle = .lightContent
Upvotes: 3
Reputation: 5186
When you override preferredStatusBarStyle
in a viewcontroller then it will work for that controller. But if you want to change whole application status bar style then put this line of code in you AppDelegate
class.
UIApplication.shared.statusBarStyle = .lightContent
Upvotes: 0