【发布时间】:2019-07-06 05:57:45
【问题描述】:
我在 tableview 上方添加了一个 UIView 以使其可滚动并在其下方有一些 tableviewcell,但我无法弄清楚如何设置“Detail Header”视图的高度动态以使其适合我的内容。我有一个 textLabel ,因此会增加它的高度
View 内的所有约束都很好,但不知何故 UIView 不适应内容并保持其固定大小
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return detailHeader
}
【问题讨论】: