Change height of UITableView programmatically

后端 未结 3 1727
有刺的猬
有刺的猬 2021-01-26 05:56

I have a UITableView and I\'d like to change its height programmatically depending on the number of cells contained in it.

Can you help me?

3条回答
  •  梦谈多话
    2021-01-26 06:19

    You can use this code

    self.yourTableView.frame = CGRectMake(x,y,width,noOfCell*heightOfOneCell);
    

提交回复
热议问题