Reputation: 868
How to set Tableview height dynamically like in android. i tried with following code, but its not working.
tblHeightConstraint.constant = downSelectionTbl.contentSize.height
see this below link i tired upvote answers even though its not resolved my issue.
Upvotes: 1
Views: 7525
Reputation: 5955
Do like this,
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
tblHeightConstraint.constant = downSelectionTbl.contentSize.height
}
Upvotes: 10