Large title to small title switch in navigation bar is not smooth iOS 13, sticky

前端 未结 3 960
旧巷少年郎
旧巷少年郎 2020-12-15 06:14

I have a UINavigationController with default value of it\'s navigationBar.prefersLargeTitles = true .

I am switching that to false

相关标签:
3条回答
  • 2020-12-15 06:54

    I had the same issue and had to place a NavigationItem on the second ViewController's storyboard. My NavigationItem was being created automatically by the segue and its prefersLargeTitle in the viewDidLoad() was not finished creating before the view appeared. Adding a NavigationItem to the storyboard fixed this issue and allowed me to set the prefersLargeTitle in the storyboard's properties menu.

    0 讨论(0)
  • 2020-12-15 06:58

    In my case this problem was occurring during a segue to a view controller which is a child of a UITabBarController. Setting largeTitleDisplayMode on the child view controller was not enough to fix this bug.

    I have solved the issue by adding a navigation item to the UITabBarController scene and setting largeTitleDisplayMode as .never there.

    0 讨论(0)
  • 2020-12-15 07:04

    What you're doing was always wrong. You should set prefersLargeTitles to true once for the navigation bar and never touch it again.

    The way to change what each view controller does about large titles as it appears is that that view controller sets its own navigationItem (in its viewDidLoad) to have the desired largeTitleDisplayMode. So if the first v.c. has .always and the second has .never everything will be smooth.

    0 讨论(0)
提交回复
热议问题