I want to hide the navigation bar for a specific view, and add my own custom "back button"
The way I am doing this now is by:
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBarHidden = true
}
It works but it takes 0.2 sec before the bar gets hidden, so you kinda can see it jump up once the view loads. Is there any other way to hide it?
How To Hide Navigation Bar In Swift. To hide the navigation bar in Swift, you'll need to add code to two methods: viewWillAppear and viewWillDisappear . That's it to hide the navigation bar in your view controller.
If you want to view files or use apps in full screen, double-tap the Show and hide button to hide the navigation bar. To show the navigation bar again, drag upwards from the bottom of the screen.
I was facing the same issue, this was fixed using the following method:
self.navigationController?.setNavigationBarHidden(true, animated: true)
Do it in the viewDidLoad for that view because the viewDidAppear runs once the view is shown to the user. You could also try setting the alpha of the navbar to 0 for faster action.
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