contentInset无法使用UISearchDisplayController tableView?

San*_*ndy 2 scroll hide uisearchdisplaycontroller ios

使用UISearchDisplayController,我显示UIView在底部,因此导致在滚动表时隐藏过滤的数据.我使用contentInset属性在底部显示数据.

我的问题是,即使我重置UIEdgeInsetsZero ,NSStringFromUIEdgeInsets(self.searchDisplayController.searchResultsTableView.contentInset)也会显示该bottom216.

当我进行多次搜索时,滚动后看不到更多数据:

在此输入图像描述

lbs*_*eek 7

如果你想设置self.searchDisplayController.searchResultsTableView.contentInset,你应该在委托中做:

- (void)searchDisplayController:(UISearchDisplayController *)controller didShowSearchResultsTableView:(UITableView *)tableView {
    controller.searchResultsTableView.contentInset = UIEdgeInsetsMake(0.0f, 0.f, 30.f, 0.f);
}
Run Code Online (Sandbox Code Playgroud)