iosswiftuinavigationcontrollerpreferslargetitles

largeTitleDisplayMode doesn't work properly?


I added the UINavigationBar with a large title in it. After that, I added a UITableView to this UIViewController. I gave the large title content mode to .always. But when I scroll the UITableView it hides and showed in the top of theUINavigationBar`

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

Solution

  • If you want to keep your large title while scrolling your UITableView, then add a UIView on top of your UITableView, like:

    enter image description here