【发布时间】:2018-08-09 13:10:24
【问题描述】:
如何像在 android 中一样动态设置 Tableview 高度。我尝试使用以下代码,但它不起作用。
tblHeightConstraint.constant = downSelectionTbl.contentSize.height
请参阅下面的链接,即使它没有解决我的问题,我也厌倦了投票答案。
【问题讨论】:
标签: ios swift uitableview
如何像在 android 中一样动态设置 Tableview 高度。我尝试使用以下代码,但它不起作用。
tblHeightConstraint.constant = downSelectionTbl.contentSize.height
请参阅下面的链接,即使它没有解决我的问题,我也厌倦了投票答案。
【问题讨论】:
标签: ios swift uitableview
这样做,
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
tblHeightConstraint.constant = downSelectionTbl.contentSize.height
}
【讨论】: