【问题标题】:TableView in TableViewCell with auto height具有自动高度的 TableViewCell 中的 TableView
【发布时间】:2017-04-30 19:21:21
【问题描述】:

我有一个这样的单元格

里面tableView是不滚动的,但是有动态单元格,动态contentSize

tableView 的高度取决于单元格

当我使用UITableViewAutomaticDimension 自动调整单元格大小时,

contentTableView.rowHeight = UITableViewAutomaticDimension

它不适用于内部tableView

它只显示单元格的标签,而不是tableView

有答案吗?谢谢

【问题讨论】:

标签: ios swift uitableview


【解决方案1】:

先写到viewDidLoad

self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 44.0;

StoryBord 中将numberOfLine 属性设置为0

将 UILable autolayout 设置为 Leading Trailing Top Bottom from SuperView

希望它会起作用......

详细说明请参考Answer

【讨论】:

    猜你喜欢
    • 2012-08-09
    • 1970-01-01
    • 2015-07-16
    • 1970-01-01
    • 2020-12-06
    • 2018-01-23
    • 2015-07-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多