UISearchController in NavigationItem iOS 11 Apple way(NavigationItem iOS 11 Apple 方式中的 UISearchController)
问题描述
在 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:NavigationItem iOS 11 Apple 方式中的 UISearchController


- 如何在 iPhone 模拟器中重置 NSUserDefaults 数据? 2022-01-01
- 网上有没有好的 UIScrollView 教程? 2022-01-01
- 使用自动布局向 UIScrollView 添加动态大小的视图 2022-01-01
- 类似于 Mail.app 的 iPad 模态视图控制器? 2022-01-01
- 在 Iphone SDK 的导航栏上添加多个按钮 2022-01-01
- GPS状态的广播接收器? 2022-01-01
- URL编码Swift iOS 2022-01-01
- SetOnItemSelectedListener上的微调程序错误 2022-01-01
- UITextView 内容插图 2022-01-01
- Xcode 7.3 中带有 UILabel 的 UIStackView 2022-01-01