I'm using auto layout to get the heights of rows in UITableView
, as described here. That part works.
I stack some labels, so they look like this in Interface Builder:
The constraints are what you'd expect, V:|-lab1-lab2-lab3-|
. Problem is, it thinks that's ambiguous and demands you change vertical content hugging priorities.
It shouldn't be ambiguous. The labels should define the height of the row. But IB seems to be taking the height of the row, which you can drag to whatever you want in IB, as something that will constrain the labels, when really at run time the intent is for the label content to determine the height of the row. In this image the row height is slightly larger than it should be at run time, so the green label is getting pulled away from it's text content, and IB starts asking about content hugging priorities. Normally I'd resolve this problem by clicking "Update Frames", which would pull the row height down to the label heights, but "Update Frames" has no effect on row heights in UITableView
.
Is there a standard way to resolve this? I would think people hit this all the time if they use auto layout for row heights.