Calculate the table's contentSize.height with custom cells of different types iphone

前端 未结 7 1149
-上瘾入骨i
-上瘾入骨i 2020-12-16 15:03

In my application , the tableview is having different types of custom cells with different heights. I want to put a view below this tableView, for which I need to calculate

7条回答
  •  时光说笑
    2020-12-16 15:41

    If you've implemented your own custom cells, then you've probably already implemented this function in your table delegate:

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

    Just iterate through your rows, calling this function for each one, and sum up the result.

提交回复
热议问题