根据内容调整UITableViewCell高度

时间:2016-12-10 07:40:35

标签: ios objective-c uitableview

细胞的内容正在隐藏。我试图增加细胞的高度,但它不起作用。

When I am running the app

In my storyboard

我试过了:

 self.tableView.estimatedRowHeight = 80
 self.tableView.rowHeight = UITableViewAutomaticDimension

并尝试了

self.tableView.setNeedsLayout()

self.tableView.layoutIfNeeded()

请帮我弄清楚

是什么错误

1 个答案:

答案 0 :(得分:0)

检查标签的垂直约束。您需要在以下内容之间设置固定间距:

  1. Top& label1的
  2. Label1& LABEL2
  3. Label2& LABEL3
  4. Label3&底
  5. 这样所有三个标签都有动态高度,单元格也有适当的高度。

相关问题