Ant
Ant

Reputation: 767

dynamic height for static table cell with nested table view

for labels, cells will automatically adjust its height after you have set the constraints and

self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 60.0

but i have a static table, and in one of the cells, i have an inner table view

i just drag a table view into the cell and bind it with data

cell #1 with the name label will expand when the text is long enough. but cell #5 doesn't expand to the full height of the inner table.

any way i can get auto layout to work with tables?

it should list out "user 1", "user 2"

Upvotes: 1

Views: 493

Answers (1)

Michael E
Michael E

Reputation: 674

There is a heightForRowAtIndexPath delegate protocol you can invoke to size the outer tableView's rows. I'm not sure how you are sizing the inner table view, so I can't be more specific in how to calculate the size for the row in question.

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableViewDelegate_Protocol/#//apple_ref/occ/intfm/UITableViewDelegate/tableView:heightForRowAtIndexPath:

Upvotes: -1

Related Questions