Search code examples
iosswiftuinavigationcontrolleruilabeluinavigationbar

How do I turn off large titles for UINavigationBar?


I have a UITableView and a Detail View embedded in a UINavigationController as so: enter image description hereI would like to turn on large titles for "My Notes" but I'd like to turn it off for the detail view. Something like how the default Mail app works on iPhone. How would I change the navigation bar's prefersLargeTitle property during that segue?


Solution

  • it's very simple.

    In your DetailView you should set navigationItem.largeTitleDisplayMode to .never

    (not navigationController?.navigationItem.largeTitleDisplayMode !!)

    navigationItem.largeTitleDisplayMode = .never