NavigationItem iOS 11 Apple中的UISearchController [英] UISearchController in NavigationItem iOS 11 Apple way

查看:41
本文介绍了NavigationItem iOS 11 Apple中的UISearchController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS 11中,Apple提供了新的搜索栏,但在iOS 11.2.2中,当两个视图控制器都具有searchController时,开发人员会出现push \ pop动画错误.苹果在文件"应用程序中展示了他们的愿景.有人知道怎么做吗?

In iOS 11 Apple presented new search bar, but yet in iOS 11.2.2 developer have push\pop animation bug when both view controllers have searchController. Apple demonstrate their vision in Files app. Do someone know how do it?

edit#1

动画损坏的问题.

您可以在ViewController中添加一些代码行-viewDid为导航栏中的搜索栏加载一些代码行

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆