UINavigationBar中的UISearchBar,防止隐藏

时间:2012-12-12 10:35:27

标签: iphone ios ipad uinavigationbar uisearchbar

我已将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;
}

0 个答案:

没有答案