UISearchController和SearchResultsTableView之间的额外空间

时间:2016-02-01 14:42:51

标签: ios objective-c uisearchcontroller

我在i-9的objective-c中使用UISearchController并面临一个非常不寻常的问题,请参阅下图:

enter image description here 我用self.automaticallyAdjustsScrollViewInsets = NO;尝试了各种各样的事情 并且重新构思视图,但没有任何作用,任何人都可以帮忙解决这个问题吗?

下面是我设置UISearchController的代码

 UITableViewController *searchResultsController = [[self storyboard] instantiateViewControllerWithIdentifier:@"SearchResultsViewController"];

    self.searchController=[[UISearchController alloc]initWithSearchResultsController:searchResultsController];
    self.searchController.searchResultsUpdater=self;
    self.searchController.dimsBackgroundDuringPresentation=NO;
    self.searchController.searchBar.placeholder = @"Enter city";
    self.searchController.searchBar.delegate = self;
    self.searchController.searchBar.tintColor=[UIColor whiteColor];
    self.searchController.searchBar.backgroundColor=[UIColor blackColor];
    self.searchController.searchBar.barTintColor=[UIColor blackColor];
    self.searchTableView.tableHeaderView = self.searchController.searchBar;
    self.searchController.hidesNavigationBarDuringPresentation=YES;

0 个答案:

没有答案