Reloading UITableView behind UISearchDisplayController

前端 未结 9 2107
南旧
南旧 2021-02-07 11:26

I\'ve run into this really strange phenomenon that I can\'t quite figure out. I have a UITableViewController that manages a UITableView. Pretty simple. I also have a UISearch

9条回答
  •  醉话见心
    2021-02-07 11:58

    I solved this in iOS 7 by only reloading the visible rows in the underlying table.

    - (void)searchDisplayController:(UISearchDisplayController *)controller didHideSearchResultsTableView:(UITableView *)tableView
    {
       [self.tableView reloadRowsAtIndexPaths:[self.tableView indexPathsForVisibleRows] withRowAnimation:UITableViewRowAnimationNone];
    }
    

提交回复
热议问题