Prevent a UISearchDisplayController from hiding the navigation bar

后端 未结 15 1556
南方客
南方客 2020-11-27 11:59

Whenever a user begins editing a UISearchDisplayController\'s search bar, the search controller becomes active and hides the view\'s navigation bar while presen

15条回答
  •  清酒与你
    2020-11-27 12:15

    As jrc pointed out "unhook UISearchDisplayController from controlling any UISearchBar" seems to work for me. If I pass nil as a parameter when creating UISearchDisplayController the navigation bar stays visible at all times:

    searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:nil contentsController:self];
    

提交回复
热议问题