刷新tableView某一行高度

2018-06-27  本文已影响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];

上一篇下一篇

猜你喜欢

热点阅读