I want the dynamic overall height of a uitableview, not a uitableviewcell,

I want to dynamically get the overall height of a uitableview, not a UITableViewCell , not a frame, and I find self.tableView.contentSize.height=0 for the first time, so I am really at a loss for this problem, I need help.

thanks...

+4
source share
2 answers

You can use the contentSize property for a UITableView, but you must first place the tableView first. Check this answer fooobar.com/questions/138195 / ...

+3
source

self.tableView.contentSize.height is the right way to do this, but you need to load the table view before calling it, so put [tableView reloadData]; before calling self.tableView.contentSize.height [tableView reloadData]; .

+3
source

Source: https://habr.com/ru/post/1489035/


All Articles