2

enter image description here

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?

Hoang Trung
  • 263
  • 4
  • 15

2 Answers2

0

What you need to do is to create a custom navigation bar and use it instead. It will look much better. I have had similar issues and the only thing that solved it for me was to create the custom navigation bar. Go to your Storyboard and add it:

enter image description here

Rashwan L
  • 38,237
  • 7
  • 103
  • 107
0

I'm attaching a sample project for your reference, everything is setup via storyboard, no code. Hope it helps!

file link

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.

Prashant
  • 336
  • 3
  • 18