经过反复试验和错误很多,我发现当searchdisplaycontroller结束搜索,搜索栏会消失,所以我重新插入到搜索栏表头和它为我工作。

- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller
{
    self.searchingFetchedResultsController = nil;
    if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
        [self.tableView insertSubview:self.searchDisplayController.searchBar aboveSubview:self.tableView];
    }
    return;
}
 
 

相关文章:

  • 2021-10-06
  • 2021-06-25
  • 2022-01-23
  • 2022-12-23
  • 2021-10-19
  • 2021-09-28
  • 2021-05-05
  • 2021-11-13
猜你喜欢
  • 2022-12-23
  • 2021-09-28
  • 2021-11-06
  • 2021-08-03
  • 2021-10-08
  • 2021-05-31
  • 2022-01-22
相关资源
相似解决方案