美文网首页iOS基础控件iOS 开发iOS 进阶
iOS: TableView如何刷新指定的cell 或secti

iOS: TableView如何刷新指定的cell 或secti

作者: 远处那片海 | 来源:发表于2016-06-30 11:18 被阅读11227次
    • 一个section刷新
    NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];    
    [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];    
    
    • 一个cell刷新
    NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];    
    [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];
    

    相关文章

      网友评论

      • 1258fdbb8c98:好像刷新的时候有时会跳到上面去,该怎么解决?
        WLAnswer:@taylorX 可以的,兄弟
        1258fdbb8c98:@WLAnswer:我解决的方法设置tableView.estimatedRowHeight =相对合理的估算高度(你试着改下这个值).
        WLAnswer:兄弟解决了吗,我也只这个问题

      本文标题:iOS: TableView如何刷新指定的cell 或secti

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