I googled for similar issues, but none of them actually solves this. I tried to push from a view controller with normal navigation bar, to a new view controller with transparent navigation bar. This is the code in 2nd view controller that I used to set navigation bar transparent
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) self.navigationController?.navigationBar.shadowImage = UIImage() navigationController?.navigationBar.barTintColor = .clear self.navigationController?.navigationBar.isTranslucent = true
How can I get a smooth transition without having a piece of light gray on navigation bar during transition?
I'm attaching a sample project for your reference, everything is setup via storyboard, no code. Hope it helps!
Here's what the project achieves, on the viewController showing the button, the navigation bar is visible, and when the button is clicked, another viewController is pushed into view, but the navigation bar is hidden completely from view. It only appears when the user taps anywhere within the view.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.