I have a table and I want to prevent its scrolling and resize it to fit its content instead.
There a lot of similar questions-answers but they are all about static tables.
My table has sections for rows with section headers. I hide or show section cells on click on this section's header.
CGRect frame = detailsTableView.frame;
frame.size.height = detailsTableView.contentSize.height;
detailsTableView.frame = frame;
As I understand it is code I need. But how and where to call it?
My current solution is to set tableView frame in a click section view event.
I calculate a total table view height as a sum of its item heights and it has some troubles with animation. But as for the rest it works.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments