My UIViewController is embed in a navigation controller:
I tried setNavigationBarHidden:animated: to hide notificationbar. It works but there are about 2 seconds delay. Here is the screenshot:
My usage is to add it in viewDidLoad()
:
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.setNavigationBarHidden(true, animated: false)
}
How to hide navigationbar
immediately when screen is launched ?
hide the navgationBar when the ViewController init ViewController.navigationController?.setNavigationBarHidden(true, animated: false)
According the official document:
Every app must supply a launch file or at least one static image.
The delay is caused by the launch screen from the your main storyboard file. Don't set launch screen file to your Main.storyboard
file.
In Project settings > General -> App Icons and Launch Images -> Launch Screen File
:
Set it to another storyboard:
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