iPhone / iPad表视图仅重新加载一行而不是整个表

时间:2012-01-10 19:05:19

标签: iphone ios ipad uitableview reloaddata

而不是

[table reloadData]

有没有办法告诉表重新加载一行?我的疯狂是有原因的。

2 个答案:

答案 0 :(得分:8)

它在docs。该方法称为reloadRowsAtIndexPaths:withRowAnimation:。所以你会做类似的事情:

NSArray *indexPaths = [NSArray arrayWithObjects:
                       [NSIndexPath indexPathForRow:5 inSection:2],
                       // Add some more index paths if you want here
                       nil];
[tableView reloadRowsAtIndexPaths:indexPaths withRowAnimation: UITableViewRowAnimationFade];

答案 1 :(得分:1)

是的,有:

(void)reloadRowsAtIndexPaths:(NSArray *)indexPaths 
          withRowAnimation:(UITableViewRowAnnimation *)annimationStyle