Search code examples
iosswiftautolayoutuistackview

ios - UIStackView and multiline UILabels


I'm trying to put multiline UILabels into the vertical UIStackView and then put this UIStackView into the horizontal UIStackView alongside other views (UIImage and UIButton).

My problem is that number of lines of the label is always one. Is it possible to force the label become multiline without specifying the width of the vertical stack?

Want to implement something like this: enter image description here


Solution

  • Of course you can do that...

    enter image description here

    "Outer" horizontal stack view:

    enter image description here

    "Inner" vertical stack view:

    enter image description here