UITableViewCell height auto layout not working on iOS 10

后端 未结 1 993
醉酒成梦
醉酒成梦 2021-02-06 05:18

I have a very simple UITableViewController, where I want to set a text on each textLabel of the UITableViewCells.

The height shoul

相关标签:
1条回答
  • 2021-02-06 05:40

    This configuration from your viewDidLoad:

    tableView.estimatedRowHeight = UITableViewAutomaticDimension
    tableView.rowHeight = UITableViewAutomaticDimension
    

    ...works only on iOS 11. It is an iOS 11 innovation and does not apply to earlier systems.

    For iOS 10, you must supply an actual estimatedRowHeight value (such as 60) to turn on automatic variable row height calculation.

    0 讨论(0)
提交回复
热议问题