I have a tableview cell that contains a UIStackView. The stack view contains two labels that could be multiple lines and another stackview at the bottom. This is how the cell should appear, but with more margin. This has a 15 point constraint on the top and bottom on the profile pic ImageView to the superview. Ideally, the 15pt top and bottom constraint would be on the stack view.
When I add the top and bottom constraints from the stack view to the superview, the middle multi-line label is forced to 1 line.
I would like the top and bottom margin with all labels to properly show multiple lines.
If I set the bottom label's vertical resistance higher than the top label, the the top label disappears.
If I set the Vertical Content Hugging Priority to one Label, the other Label gets clipped. If I set both labels Hugging Priority to be equal, the constraints aren't satisfied, and it asks me to make one higher.
I don't understand the logic, I want both labels to grow in height based on the content and size the cell accordingly. Why would I need to give one a Priority?
If I remove the top and bottom constraints from the stack view to the cell's content view, then don't have to set one label's Content Hugging priority higher than the other. But I want the top and bottom constraints for margin.
I tried constraining the labels to the stack views, but it produced the same results. The stack view Alignment is set to Fill. Distribution is set to Fill Proportionally. Changing these values did not change much. The tableview is estimated row height and row height is set to automatic dimension.
Any suggestions?