Keeping UINavigationController's navigationBar hidden after UISearchDisplayController selection

后端 未结 5 2106
孤独总比滥情好
孤独总比滥情好 2021-02-04 05:16

I have a UISearchDisplayController setup with a UITableViewController which is nested inside a UINavigationController. When a selection o

5条回答
  •  心在旅途
    2021-02-04 05:53

    I had the same problem: my view has the navigation bar hidden by default and here's the way to keep it hidden:

    -(void) viewWillLayoutSubviews{
      if (self.navigationController.navigationBar.hidden == NO)
      {
        [self.navigationController setNavigationBarHidden:YES animated:YES];
      }
    }
    

    This way the navigation bar doesn't appear even after the search bar has been used.

提交回复
热议问题