UITableViewCell content flickers while reloading cells individually

前端 未结 5 1189
余生分开走
余生分开走 2021-02-08 13:25

I have a table view linked to a NSFetchedResultController (i.e. loading data and also tracking changes to data is bound to the FRC)

I\'m not using Auto

5条回答
  •  攒了一身酷
    2021-02-08 13:54

    I was also facing same problem of flickering UITableViewCell while using reloadRowsAtIndexPath, so what I did was -

         [UIView setAnimationsEnabled:NO];
         [self.tableView beginUpdates];
    
         [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil]
                                                   withRowAnimation:UITableViewRowAnimationNone];
         [self.tableView endUpdates];
         [UIView setAnimationsEnabled:YES];
    

    The above snippet will have no animation on cells while reloading the cell.

提交回复
热议问题