0

我已经UISearchBar输入了UINavigationBar,但问题是当我点击时UISearchBarUINavigatioBar隐藏,如何解决这个问题?

代码:

searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 250, 44)];

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

searchDisplayController.delegate = self;
searchDisplayController.searchResultsDataSource = self;

self.tableView.tableHeaderView = searchBar;

-(void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar

-(void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar

{
    self.navigationController.navigationBar.hidden = NO;
}
4

0 回答 0