How to dynamically set the height of a UITableView?

后端 未结 5 2125
独厮守ぢ
独厮守ぢ 2020-12-29 14:23

I have a tableview with different cell heights using the heightForRowAtIndexPath: method.

I would like to dynamically set the height of a UITable

5条回答
  •  有刺的猬
    2020-12-29 15:04

    Try this in viewDidLoad:

    [tableView setFrame:CGRectMake(tableView.frame.origin.x, tableView.frame.origin.y + 4, tableView.frame.size.width, tableView.frame.size.height - 65)];
    

提交回复
热议问题