I have an UITableView (aka. ParentTableView) with multiple UITableViewCell's. Each UITableViewCell contains some labels and an UITableView (aka. ChildTableView).
The ChildTableView's rows have different amounts of UITableViewCells.
There is two things I need help to figure out.
After tableView finishes loading cells ( gets its content ) update the Frame of the TableView with the Content Size.
so after reloadData
:
var bounds = tableView.bounds
bounds.size.height = tableView.contentSize.height
// You can add anything to the height now with bounds.size.height += something
tableView.bounds = bounds
You can also explicitly disable the scrolling with scrollEnabled = false
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.