iOS 11 prefersLargeTitles not updating until scroll

前端 未结 24 2356
轻奢々
轻奢々 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:25

    General changing the behaviour of the navigationBar should be done in viewWillAppear(_:)

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.navigationController?.navigationBar.prefersLargeTitles = true
    }
    

    After doing that it worked fine for me.

提交回复
热议问题