5

Large navigations bars were displayed by default but it suddenly changed to smaller title, probably in a recent update. I'm experience this issue with UICollectionViewController even though to confirm, I add the following code to the viewDidLoad method.

self.navigationController?.navigationBar.prefersLargeTitles = true
self.navigationItem.largeTitleDisplayMode = .always;

Any leads appreciated! :)

Antony Raphel
  • 2,036
  • 2
  • 25
  • 45
Anushk
  • 482
  • 4
  • 20
  • I have also tried programmatically scrolling to the top, but this doesn't display the large navigation bar either. Interestingly, it shows when I tap on the status bar to scroll to the top. – Anushk Dec 20 '17 at 11:57

1 Answers1

4

I referred to iOS 11 large-title navigation bar not collapsing and although Apple has resolved the OPs issue, they introduced a new bug wherein if you set prefersLargeTitle and c via code, it results in large titles being displayed only when you manually scroll up.

Fix:

- Check largeTitleDisplayMode via storyboard

- Set largeTitleDisplayMode as "Automatic" via storyboard

- Remove any similar code from your View Controllers

Anushk
  • 482
  • 4
  • 20
  • 2
    I couldn't find `largeTitleDisplayMode` option in the storyboard. I just checked `Prefers Large Titles` while inspecting the `Navigation Bar` of the root Navigation Controller in the storyboard and removed any germane code from the view controller's source file. That seemed to do the job. – mohak Mar 03 '18 at 20:21
  • 1
    Good point at explaining this Xcode bug, tried different configurations in code and none of them worked. @mohak you can find Storyboard's largeTitleDisplayMode on the Navigation Item of your NavigationController's root View Controller. Set the "Large Title" menu in the Attributes Inspector. – Marcos Reboucas Mar 30 '18 at 01:07