iOS 11 large-title navigation bar not collapsing

后端 未结 7 763
长发绾君心
长发绾君心 2020-12-02 18:31

The Apple guy in the What\'s new in Cocoa Touch WWDC video said that the new large-title navigation bar will magically hook into the top-level scroll view of the underlying

7条回答
  •  隐瞒了意图╮
    2020-12-02 19:01

    Or instead of changing anything in storyboard, do this:

    override func viewDidLoad() {
        super.viewDidLoad()
        if #available(iOS 11.0, *) {
            self.navigationItem.largeTitleDisplayMode = .never
            self.navigationItem.largeTitleDisplayMode = .always
        }
    }
    

    No matter which language!

    This is because large titles on navigation item decides whether or not to collapse on the basis of large title behaviour on previous screen navigation item title.

提交回复
热议问题