數(shù)據(jù)刷新方法
[self.tableView reloadData];
[self.tableView reloadRowsAtIndexPaths:@[
[NSIndexPath indexPathForRow:0 inSection:0],
[NSIndexPath indexPathForRow:1 inSection:0]
]
withRowAnimation:UITableViewRowAnimationLeft];
[self.tableView insertRowsAtIndexPaths:@[
[NSIndexPath indexPathForRow:0 inSection:0],
[NSIndexPath indexPathForRow:1 inSection:0]
]
withRowAnimation:UITableViewRowAnimationLeft];
[self.tableView deleteRowsAtIndexPaths:@[
[NSIndexPath indexPathForRow:0 inSection:0],
[NSIndexPath indexPathForRow:1 inSection:0]
]
withRowAnimation:UITableViewRowAnimationLeft];
數(shù)據(jù)刷新的原則
- 通過(guò)修改模型數(shù)據(jù)望众,來(lái)修改tableView的展示
- 先修改模型數(shù)據(jù)
- 再調(diào)用數(shù)據(jù)刷新方法
- 不要直接修改cell上面子控件的屬性
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者