UITableView scrolls to top when reloading cells with changing cell heights

后端 未结 4 917
面向向阳花
面向向阳花 2020-12-09 05:57

I have a table view which contains a placeholders while it loads in images. When the image is loaded, I call reloadRowsAtIndexPaths:withRowAnimation:. At this p

4条回答
  •  借酒劲吻你
    2020-12-09 06:45

    Always update the UI on the main thread. So just place

    [self.tableView reloadData];
    

    inside a main thread:

    dispatch_async(dispatch_get_main_queue(), ^{
         //UI Updating code here.
         [self.tableView reloadData];
    });
    

提交回复
热议问题