Ram*_*Ram 0 uitableview ios swift
如何像Android中一样动态设置Tableview高度。我尝试使用以下代码,但无法正常工作。
tblHeightConstraint.constant = downSelectionTbl.contentSize.height
Run Code Online (Sandbox Code Playgroud)
看到下面的链接,即使它不能解决我的问题,我也很讨厌投票。
这样吧
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
tblHeightConstraint.constant = downSelectionTbl.contentSize.height
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3284 次 |
| 最近记录: |