0

Nib setup: TableViewCell, contentView contains a TextView

Set vertical space and horizontal space constraints so TextView is flush against the contentView (top, bottom, leading and trailing, to equal and constant to 0).

When I add a Height constraint to the TextView, I get a constraint error. What I expected is the TableCell/ContentView to automatically expand when the TextView changes size. Is this not the way to resize TableViewCells?

XCode screenshot

Community
  • 1
  • 1
phillee
  • 2,227
  • 2
  • 19
  • 28

1 Answers1

0

I think I have a link to the answer you are looking for right here in Stack Overflow: Using Auto Layout in UITableView for dynamic cell layouts & variable row heights

Community
  • 1
  • 1
svena
  • 2,769
  • 20
  • 25
  • that's a great post but my question is different. I'm wondering why I can't set an inner view's height constraint to auto-set the outer view's height. – phillee May 21 '14 at 09:06
  • I believe it's because row height is not controlled by auto layout. In fact table view cell itself is not auto layout compatible either. But you can use auto layout inside your own view downwards from the contentView of the cell. – svena May 21 '14 at 09:38