我已经UISearchBar
输入了UINavigationBar
,但问题是当我点击时UISearchBar
,UINavigatioBar
隐藏,如何解决这个问题?
代码:
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;
}