简体   繁体   中英

UINavigationbar with large titles pop back animation glitch

i have a view controller with large titles enabled and navigate to another view controller where large titles are disabled and has a uisearchcontroller attached to its navigation bar. When i pop back to previous controller there is a bad ui glitch where its very easy to spot and looks horrible. Does anyone have any idea how to fix it?

In the second view controller:

navigationController?.navigationBar.prefersLargeTitles = false
navigationItem.searchController = searchController

Link to the gif that shows the ui glitch

Thanks everyone, i am open for ideas as well.

In the second view controller instead of setting, prefersLargeTitles = false use the below code. This will fix the issue.

self.navigationItem.largeTitleDisplayMode = .never

Please check your code in viewWillAppear or viewDidAppear. It will always handle the navigation animations and it's probably causing the glitch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM