I want to make my navigation controller like this. My main view should continue to the top.
But when I am trying implement it I get this result:
How can I handle this problem. I want to implement something like in first image. Can anybody help? Thanks
I use this in my Apps to make my navigationBar transparent (if the navigationBar is in a UINavigationController):
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default)
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.translucent = true
Now you can still add buttons and a title to your navigationBar.
EDIT: Swift 3 (Thanks to DrBreakalot)
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.isTranslucent = true
Since you already have your title and button in your view, it looks like you want to hide the navigation bar rather than make it transparent. If you don't want the navigation bar on any of your screens you can uncheck 'Shows Navigation Bar' in the Storyboard.
Or, if you only want to hide the navigation bar on certain screens, you can set it in viewDidLoad()
navigationController?.setNavigationBarHidden(true, animated: true)
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