iOS Navbar starts as a small instead of large iOS

2019-08-29 05:52发布

问题:

When I launch my app, my Navbar automatically starts as a small one, but I have specified in my code to use large navigation bars: navigationController?.navigationBar.prefersLargeTitles = true, I'm using a collectionView in the same ViewController.

Every time I launch my app I have to scroll down to get the iOS 11 style Navbar to appear. What could cause this problem?

Result when I launch my app:

Result when I slide down and what it should look like when the app initially launches

Storyboard

回答1:

In your Storyboard, select the navbar, and in the attributes selector choose the following option: