I have a problem, I am working with Xcode 11.3.1 and when I run my app, which was created in a previous version of Xcode, my statusBar is not visible, I don't know if it is a bug in the emulators or if I need some configuration .
If I run my app it appears like this.
I don't understand why the statusBar is not being shown, I have tried with this code but it doesn't work for me.
self.navigationController?.setNavigationBarHidden(false, animated: true)
if #available(iOS 13.0, *){
let navBarAppearance = UINavigationBarAppearance()
navBarAppearance.configureWithOpaqueBackground()
navBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
navBarAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
navBarAppearance.backgroundColor = UIColor.red
self.navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance
self.navigationController?.navigationBar.standarAppearance = navBarAppearance
}
But I have not been able to show the status bar.
I have it like this:
The difference with your code is the last two lines, I assign it directly to
self.navigationItem
and in your code you add it to theself.navigationController?.navigationBar
.You can try adding directly to the
navigationItem
one you have and commenting out this line: