在 iOS 11 中,Apple 提供了新的搜索栏,但在 iOS 11.2.2 中,当两个视图控制器都有 searchController 时,开发人员会出现 pushpop 动画错误.Apple 在文件应用程序中展示了他们的愿景.有人知道怎么做吗?
In iOS 11 Apple presented new search bar, but yet in iOS 11.2.2 developer have pushpop animation bug when both view controllers have searchController. Apple demonstrate their vision in Files app. Do someone know how do it?
编辑#1
动画损坏的问题.
你可以在 ViewController 中添加一些代码 -viewDidLoad 一些代码行用于导航栏中的搜索栏
you can add some line of code in ViewController -viewDidLoad some line of code for search bar in navigation bar
self.navigationController?.navigationBar.prefersLargeTitles = true
self.navigationItem.largeTitleDisplayMode = .automatic
let search = UISearchController(searchResultsController: nil) // Declare the searchController
self.navigationItem.searchController = search
这篇关于NavigationItem iOS 11 Apple 方式中的 UISearchController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!