UITableViewCell auto height based on amount of UILabel text

前端 未结 5 1424
终归单人心
终归单人心 2020-12-03 20:54

I have a bit of a tricky set up in my storyboard, I have a UIViewController that holds a UITableViewController. Within the UITableViewController I have several prototypecell

5条回答
  •  误落风尘
    2020-12-03 21:44

    Use UITableViewAutomaticDimension

    tableView.rowHeight = UITableViewAutomaticDimension
    tableView.estimatedRowHeight = 300
    

提交回复
热议问题