导航栏中的UISearchController无法在iOS 11上正确隐藏

时间:2017-10-26 10:28:10

标签: ios uinavigationbar ios11 uisearchcontroller abcustomuinavcontroller

我想点按

后隐藏导航栏
navigationController?.hidesBarsOnTap = true

点击后,navigationBar会正常隐藏 hide Navigation Bar

但是在添加了searchController(下面的代码)之后

let searchController = UISearchController(searchResultsController: nil)
navigationItem.searchController = searchController

我的视图(青色)无法正确延伸

not properly

我也试过旋转它。出现搜索栏。

enter image description here

1 个答案:

答案 0 :(得分:0)

终于找到了解决方案

MacBook-Pro-2:~ admin$ which python2
/usr/local/bin/python2
MacBook-Pro-2:~ admin$ 
MacBook-Pro-2:~ admin$ which python3
/usr/local/bin/python3
MacBook-Pro-2:~ admin$ 

example code