zoukankan      html  css  js  c++  java
  • IOS UITableView reload 刷新某一个cell 或 section

    通常刷新整个列表 我们都使用[self.tableView reloadData];

    有的时候,有变化更新的只是某一行 row 或者是某个section 所以只更新这一行就好了

    //一个section刷新
    int section_index=10;//更新第11个sectioin
    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:section_index] withRowAnimation:UITableViewRowAnimationNone];
    //一个cell刷新    
    NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];  //更新 第一个section的第4行  
    [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];  
  • 相关阅读:
    HIHO线段树(成段)
    HIHO 线段树(单点)
    POJ 3468
    HDU 1754
    HDU 1698
    HDU 5119
    HDU 1394
    HDU 1166
    DZY Loves Chessboard
    谷歌Cookies无法写入
  • 原文地址:https://www.cnblogs.com/someonelikeyou/p/4203171.html
Copyright © 2011-2022 走看看