美文网首页
tableviewcell的属性、方法、刷新

tableviewcell的属性、方法、刷新

作者: 张家杰仔 | 来源:发表于2017-04-06 10:40 被阅读25次
    cell的添加属性,都应该加在 contentView  的属性上
    如:
    [self.contentView addSubview: self.label];
    
    // 获取可以见到的 cell,让图片在cell坐标改变的时候偏移
     NSArray *array = [self.tableView visibleCells];
    
    //刷新某一section
    [self.tableview reloadSections:[NSIndexSet indexSetWithIndex:sender.tag - 100] withRowAnimation:UITableViewRowAnimationFade];
      
    
    //一个cell刷新    
    NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];    
    [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];  
    
    类别:
    UITableViewStyleGrouped 时,section不会跟着移动
    UITableViewStylePlain(默认) 时,section会跟着移动
    

    相关文章

      网友评论

          本文标题:tableviewcell的属性、方法、刷新

          本文链接:https://www.haomeiwen.com/subject/hbytattx.html