Reloading UITableView behind UISearchDisplayController

前端 未结 9 2092
南旧
南旧 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];
    }
    
    0 讨论(0)
  • 2021-02-07 12:05
    [self.searchDisplayController.searchResultsTableView reloadData];
    
    0 讨论(0)
  • 2021-02-07 12:06

    Because of using UITableViewController. self.view is a TableView in the UITableViewController and SearchDisplayController's ContainerView is added to the self.view of UITableViewController. Just use UIViewcontroller.

    0 讨论(0)
提交回复
热议问题