1

I have a problem with iOS8 autolayout / resizing. In my app, there is one full-screen table with different cells. Those cells are dynamically sized to resize based on their content using

self.tableView.estimatedRowHeight = 44.0
self.tableView.rowHeight = UITableViewAutomaticDimension

(see appcoda or stack overflow, using same set of constraints, eg. top/left/right/bottom for top label and left/right/bottom for bottom label). Resulting in something like this:

Dinamically sized cells

So this works great. Now, I need to add an extra cell that has another table embedded in it. This embedded table has dynamic number of rows, should not be scrollable, but rather should resize its containing cell according to self size. But no matter what I do with constraints, I cannot get the containing cell (highlighted in red) to grow (the table Row#0, Row#1, ... has actually 10 items, but only first two are shown).

Cannot force the cell to grow

The idea is to have something similar to native ios maps' detail, where for example Reviews looks like an embedded dynamically sized table:

iOS maps annotation detail

Community
  • 1
  • 1
Ondrej Skalicka
  • 3,046
  • 9
  • 32
  • 53
  • They aren't accomplishing what you are wanting with more than one table view, they are reloading the data on just one of them instead. – Dreaming In Binary Dec 12 '14 at 14:16
  • @DreamingInBinary okay, that might not have been the best example, sice i want to do a bit extra with the resulting table, but the questions stands the same -- is it possible to force the containing cell to grow based on inner table data / size? – Ondrej Skalicka Dec 12 '14 at 14:24
  • You generally should not nest table/web/scroll views. It really messes with the touch handling and results in unexpected behavior. – Christian Schnorr Dec 12 '14 at 14:59

0 Answers0