UISeachDisplayController在UISearchBar下显示白框?

时间:2014-10-21 19:31:52

标签: ios uisearchbar uisearchdisplaycontroller

当我点击UISearchBar时,它下面会出现一个白框,但在随后调用UISearchBarDelegate方法时,白框会消失。它仅在用户首次单击UISearchBar时显示。以下是我初始化UISearchDisplayControllerUISearchBar的代码。如何删除此白框?

- (void)viewDidLoad {

    [super viewDidLoad];

    self.searchBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, 320, 44)];
    self.searchBar.delegate = self;
    _isSearching = NO;
    self.searchCntrl = [[UISearchDisplayController alloc]initWithSearchBar:self.searchBar contentsController:self];
    self.searchCntrl.delegate = self;
    self.searchCntrl.searchResultsDataSource = self;
    self.searchCntrl.searchResultsDelegate = self;
    self.searchCntrl.displaysSearchBarInNavigationBar = YES;


}

enter image description here

0 个答案:

没有答案