iOS 11 prefersLargeTitles not updating until scroll

前端 未结 24 2355
轻奢々
轻奢々 2021-01-31 07:25

I implemented a basic UIViewController with a UITableView that\'s wrapped in a UINavigationController. I set prefersLargeTitles to true:

override fu         


        
24条回答
  •  余生分开走
    2021-01-31 08:19

    I recently hit the same issue and none of the suggestions worked for me. Instead, all I needed to do was to invoke sizeToFit(). Sample code:

    private func configureNavigator() {
        guard let navigationController = navigationController else { return }
        navigationController.navigationBar.prefersLargeTitles = true
        navigationItem.largeTitleDisplayMode = .automatic
        navigationController.navigationBar.sizeToFit()
    }
    

    I hope this helps!

提交回复
热议问题