Prevent a UISearchDisplayController from hiding the navigation bar

后端 未结 15 1660
南方客
南方客 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:21

    I was adding custom navigation bar on my ViewController which was getting hidden on search, a quick but not so good fix was

    - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{
        [self.view addSubview:_navBar];
    }
    

    _navBar is UINavigationBar added programmatically, doing this helped me navigation bar from hiding.

提交回复
热议问题