简体   繁体   中英

How to get tableview content height if tableview is in tabview cell?

The table view cell has a tableview inside it. This tableview has sections and rows, when user clicks on section the rows shows or collapse. but I can not get the content height of this cell.

on section's button click I am doing this:

self.tableViewViewHeightConstraint.constant = CGFloat.greatestFiniteMagnitude;
self.tableView.reloadData()
self.tableView.layoutIfNeeded()
self.tableViewViewHeightConstraint.constant = self.tableView.contentSize.height    
delegate?.reloadMainTable(with: self.indexPath)

after setting the constraints I am reloading this cell in main tableview with the delegate but not able to get a fixed height

Try to check contentView height of UITableviewCell

For more detail of contentView

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM