I have a collection view cell. Inside this cell, I have a stack view with two labels. One is static height and one is dynamic height.
If my hierarchy is as follows:
- Stack view (distribution = fill)
- Label (vertical hugging = 250)
- Label (vertical hugging = 249)
It sets the height fine for each cell:
But when I place the label inside a UIView:
- Stack view (distribution = fill)
- Label (vertical hugging = 250)
- UIView (vertical hugging = 249)
- Label (top, right, bottom, left constraints = superview)
It (most of the time) sets the height incorrectly:
This appears as one line when it should appear as multiple:
Adds weird padding above and below the label:
What's going on here?