0

我用范围栏创建搜索栏。当我点击搜索栏时,导航栏将被隐藏。搜索栏可以覆盖导航栏。我想在导航栏下方显示搜索栏。我能怎么做?

4

1 回答 1

0

只需将此代码转换为 hrs 即可

-(void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller{
    NSLog(@"search cancelled");
    _searchBar.frame=CGRectMake(0, 60, 320, 40);
    _arrButtons=nil;
 [_tableFriendList reloadData];


}
-(void)searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller{
    NSLog(@"hey.......");



    _searchBar.frame=CGRectMake(0, 60, 320, 40);
    //_tableFriendList.frame=CGRectMake(0, 140, 320,400);

    [self.navigationController setNavigationBarHidden: NO animated: YES];

    controller.active = YES;

    [self.view addSubview:controller.searchBar];
    [self.view bringSubviewToFront:controller.searchBar];



}
于 2014-08-05T06:52:29.363 回答