UITableView reload section

前端 未结 11 2073
余生分开走
余生分开走 2020-12-05 01:46

I want to reload only one section not the full table. Is there any method in UITableView.

[tableView reloadData] is used to load full table

11条回答
  •  一向
    一向 (楼主)
    2020-12-05 02:40

    Here is the method, you can pass section details in different ways

    [self.tableView reloadSections:[[NSIndexSet alloc] initWithIndex:1] withRowAnimation:NO];
    
    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationNone];
    

    Reloading particular sections improves performance for the table view as well some time it also avoid some issues like floating/moving custom headers-footers in your view. SO try to use reloadSection than relaodData whenever possible

提交回复
热议问题