UITableView with dynamic cell heights jumping when scrolling up after reloading cell

后端 未结 5 1421
孤街浪徒
孤街浪徒 2021-02-05 13:21

I have a table view with the potential for each cell to have its own height, thus isn\'t suitable to use rowHeight. Instead, right now I\'m using let indexSet

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-05 13:56

    I was facing the same problem, my table works fine until the tableview reloads. So i found a solution, use only rowHeight not estimated height. Also if you have different height. So please provide the complete code so i will provide a solution. I have a cell which like instagram page. I am passing calculated height in heightforrow method which work fine. But estimated height not works fine in that situation. If you use below code, it works fine. Please try.

    self.tableView.rowHeight = 75 //it will be your dynamic height
    //self.tableView.estimatedRowHeight = 75
    

    If you confuse to calculate the height for row for each cell, just post the sample i will provide the solution. If i can Thanks

提交回复
热议问题