How do I turn off large titles for UINavigationBar?

SwiftUI version

.navigationBarTitle("Title", displayMode: .inline)

it's very simple.

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

(not navigationController?.navigationItem.largeTitleDisplayMode !!)

navigationItem.largeTitleDisplayMode = .never

Any one of both of following, will solve your problem:

  1. set prefersLargeTitles to false for your navigationBar

    self.navigationController?.navigationBar.prefersLargeTitles = false
    
  2. set largeTitleDisplayMode to never for navigationItem (note: prefersLargeTitles must be false otherwise this won't work)

    self.navigationController?.navigationItem.largeTitleDisplayMode = .never
    

Note: if prefersLargeTitles is true, then largeTitleDisplayMode = .never won't work. Small title display for navigation bar is dependent on prefersLargeTitles

This will enable large title mode if it's value is true

self.navigationController?.navigationBar.prefersLargeTitles = true