Stav1
Stav1

Reputation: 130

Double navigation bar

Here is my unwanted double navigation bars:

enter image description here

In storyboard, the link is like this:

  1. A segue from the tabbar controller to this friendzone viewController
  2. friendzone VC is embedded in a navigation controller.

My navigation controller top bar is set to inferred, and friendzone VC top bar is set to hidden. I have removed all kinds of configuration to the navigation bar(like navigationItem.leftbarbutton, translucent etc). There are four other tabItems in the tab bar controller, where three of them is embedded in a navigation controller. I have found similar problems on stackoverflow, but none of the answers is working for this case.

Update: The only code I have in friendZone viewcontroller considering the navigation bar is this in viewWillAppear():

self.navigationController?.toolbarHidden = true
self.navigationController!.navigationBar.setBackgroundImage(colorImage,forBarMetrics: UIBarMetrics.Default)
self.navigationController!.navigationBar.shadowImage = colorImage
self.navigationController!.navigationBar.translucent = true

Update: An image of the storyboard. If I subclass my navigation controller and call this in viewDidLoad:

self.setViewControllers([homeViewController], animated: true)

so the homeViewController first gets loaded by storyboard segue, then with code the first homeViewController will have double navigation bar, but the second have just one

Upvotes: 1

Views: 2343

Answers (1)

SamuelD
SamuelD

Reputation: 333

I had the same issue using a tabbarcontroller and a navigation controller.

The storyboard editor doesn't change anything when you change things there. At runtime test options won't be validated.

What i did:

self.navigationController?.toolbarHidden = true

In your viewDidLoad()

Upvotes: 1

Related Questions