TonyW
TonyW

Reputation: 18875

Xcode in Swift: navigation bar not showing in UI collection view (simulator)

I am in an effort of creating an app project that uses collection view to present a list of screenshots. In the storyboard, I am pretty certain that I have the navigation bar (Root View of a Navigation Controller) set up (see the first image attached) with the constraints shown in the second image.

However, when I run the app in simulator, the navigation bar seems hidden (or covered up by the collection view??). I was wondering if I should shrink the height of the collection view in order to make the navigation bar visible.

collection view in the root view controller

constraints for the collection view

navigation bar not showing up in simulator

Upvotes: 1

Views: 1265

Answers (1)

whereisleo
whereisleo

Reputation: 828

If you say, you've set everything correctly, try this. It might work.

In your

override func viewDidLoad() {
    super.viewDidLoad()

    navigationController?.navigationBarHidden = false
}

Upvotes: 1

Related Questions