UISeachDisplayController showing white box under UISearchBar?

When I click on UISearchBar, a white box appears below it, but on subsequent method calls, the UISearchBarDelegate

white box disappears. It only shows up when the user first clicks on the UISearchBar. Here is the code where I initialize UISearchDisplayController

and UISearchBar

. How do I remove this white border?

- (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

+3


source to share





All Articles