美文网首页
刷新tableView某一行高度

刷新tableView某一行高度

作者: 秀大大 | 来源:发表于2018-06-27 15:42 被阅读8次

    刷新某一个cell

    NSIndexPath *indexPath =[NSIndexPath indexPathForRow:0 inSection:0];

    [self.tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationNone];

    在代理方法里,做好高度的处理,什么情况下需要高度变化

    -(CGFloat)tableView:(UITableView*)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath

    {

    if(self.imageIdArray.count<4){

    return 300;

            }else{

    return 385;

            }

         }

    }

    如果需要刷新section 方法如下

    NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];

    [self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone];

    相关文章

      网友评论

          本文标题:刷新tableView某一行高度

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