【问题标题】:iPhone / iPad Table View Reload Only One Row Instead Of The Entire TableiPhone / iPad 表格视图仅重新加载一行而不是整个表格
【发布时间】:2012-01-10 19:05:18
【问题描述】:

而不是一个

[table reloadData]

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

【问题讨论】:

    标签: iphone ios ipad uitableview reloaddata


    【解决方案1】:

    它在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];
    

    【讨论】:

      【解决方案2】:

      是的,有:

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

      【讨论】:

        猜你喜欢
        • 2015-09-09
        • 1970-01-01
        • 2017-10-29
        • 2018-04-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-03-02
        • 1970-01-01
        相关资源
        最近更新 更多