how to get a UITableView row height to auto-size to the size of the UITableViewCell?

前端 未结 5 842
梦谈多话
梦谈多话 2020-12-23 17:24

How to get a UITableView row height to auto-size to the size of the UITableViewCell?

So assuming I\'m creating the UITableViewCell in Interface Builder, and it hei

5条回答
  •  情书的邮戳
    2020-12-23 18:05

    If all the cells are the same, set the rowHeight property on UITableView to the size of your cell. If they're all different based on content, you're going to have to implement -tableView:heightForRowAtIndexPath: and calculate the height for each row based on your data source.

提交回复
热议问题