Reload sections in UITableView

后端 未结 6 2379
执笔经年
执笔经年 2021-02-13 11:34

I am writing an app that notifies user when its time to take his/her medicine. The label at the top of the page shows a date and the tableView gets populated with m

6条回答
  •  情书的邮戳
    2021-02-13 12:03

    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

提交回复
热议问题