问题
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