Prevent UISearchController from hiding the navigation bar

╄→гoц情女王★ 提交于 2019-12-10 02:02:08

问题


When a UISearchController's search bar becomes active, it hides the view's navigation bar. I'd like to have the search bar active below the navigation bar.

In iOS 7 there was a good way to do this for UISearchDisplayController here: https://stackoverflow.com/a/12529945/3799720

But now in iOS 8 with UISearchController I can't figure out how to do this.


回答1:


This might have something to do with the UISearchController hidesNavigationBarDuringPresentation property.




回答2:


yourSearchController.hidesNavigationBarDuringPresentation = false

this works in swift



来源:https://stackoverflow.com/questions/26303495/prevent-uisearchcontroller-from-hiding-the-navigation-bar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!