Auto-sizing UITableViewCell in iOS 8

前端 未结 3 1243
[愿得一人]
[愿得一人] 2021-01-05 06:06

I have a UITableViewCell subclass which contains a multiline label, and I would like the cell to size itself dynamically based on the content of that label. I\'m aware that

3条回答
  •  醉话见心
    2021-01-05 06:32

    Are you sure you have -translatesAutoresizingMaskIntoConstraints set to NO on the cell? If you don't, the system generates constraints based on the autoresizing mask, which was the previous way of doing layout on iOS, and should be disabled when using Auto Layout.

提交回复
热议问题