Swift: How to reload row height in UITableViewCell without reloading data

前端 未结 4 1526
死守一世寂寞
死守一世寂寞 2020-12-25 13:20

I have a case in which I have to reload only height of a UITableViewCell.

but if I call the function

tableView.reloadRowsAtIndexPaths([         


        
4条回答
  •  情话喂你
    2020-12-25 13:53

    You can use the view height constraint in the cell, by updating the view in cell height you can update the specific cell height.

    let height = cell.Height_constraint.constant
    cell.Height_constraint.constant = height + 200 //200 you can use any number
    

    Height_constraint: is the height constraint of subView in my cell.

提交回复
热议问题