防止UISearchController隐藏导航栏

防止UISearchController隐藏导航栏

问题描述:

当UISearchController的搜索栏变为活动状态时,它会隐藏视图的导航栏。我想让导航栏下方的搜索栏处于活动状态。

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.

在iOS 7中,有一种很好的方法可以为 UISearchDisplayController 执行此操作这里: https://stackoverflow.com/a/12529945/3799720

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

但现在在带有UISearchController的iOS 8中,我无法弄清楚如何做到这一点。

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

这可能有与UISearchController hidesNavigationBarDuringPresentation 属性有关。

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