Multiline label in UIStackView

Boon

When putting multiline label (with linebreak set to Word Wrap) into a stack view, the label immediately loses the linebreak and displays the label text in one line instead.

Why is this happening and how does one preserve multiline label within a stack view?

Andy

The correct answer is here:
https://stackoverflow.com/a/43110590/566360


  1. Embed the UILabel inside a UIView (Editor -> Embed In -> View)
  2. Use constraints to fit the UILabel to the UIView (for example, trailing space, top space, and leading space to superview constraints)

The UIStackView will stretch out the UIView to fit properly, and the UIView will constrain the UILabel to multiple lines.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

UIStackView multiline buttons overlapping

From Dev

UIStackView with multiple label

From Dev

multiline TextField - floating label

From Dev

Multiline Label On UIButton Swift

From Dev

CCLabelTTF multiline label not working

From Dev

Dynamically adding multiline label in a view

From Dev

How to make multiline label with Eureka

From Dev

QML Label max width & multiline

From Dev

Dynamically adding multiline label in a view

From Dev

Custom cell to display multiline label using UITableViewAutomaticDimension

From Dev

Get frame of word in a substring in a multiline label

From Dev

How To Make A Multiline Data Label In A Bar Chart?

From Dev

Java regex to match multiline records starting with fixed label

From Dev

AutoLayout with 2 multiline labels, compression resistance and minimum 1 line label

From Dev

display multiline/multiple characters as key label on soft keyboard keys

From Dev

Wrong size returned by systemLayoutSizeFittingSize when using multiline label

From Dev

Multiline Label within UITableViewCell not working with iOS 9 or Swift 2.0

From Dev

Self sizing cell with multiple labels does not show multiline label

From Dev

Can't autoresize cell in table view with multiline label

From Dev

display multiline/multiple characters as key label on soft keyboard keys

From Dev

Java regex to match multiline records starting with fixed label

From Dev

Multiline Label within UITableViewCell not working with iOS 9 or Swift 2.0

From Dev

iOS7 - Adjusting font size of multiline label to fit its frame

From Dev

How to add background line in multiline label using NSAttributedString in ios objective-c

From Dev

UIStackView not displaying

From Dev

UIStackView embedded within UIStackView alignment

From Dev

UIStackView : Change UIStackView image width using storyboard

From Dev

Multiline Radiobutton

From Dev

regex in multiline

Related Related

  1. 1

    UIStackView multiline buttons overlapping

  2. 2

    UIStackView with multiple label

  3. 3

    multiline TextField - floating label

  4. 4

    Multiline Label On UIButton Swift

  5. 5

    CCLabelTTF multiline label not working

  6. 6

    Dynamically adding multiline label in a view

  7. 7

    How to make multiline label with Eureka

  8. 8

    QML Label max width & multiline

  9. 9

    Dynamically adding multiline label in a view

  10. 10

    Custom cell to display multiline label using UITableViewAutomaticDimension

  11. 11

    Get frame of word in a substring in a multiline label

  12. 12

    How To Make A Multiline Data Label In A Bar Chart?

  13. 13

    Java regex to match multiline records starting with fixed label

  14. 14

    AutoLayout with 2 multiline labels, compression resistance and minimum 1 line label

  15. 15

    display multiline/multiple characters as key label on soft keyboard keys

  16. 16

    Wrong size returned by systemLayoutSizeFittingSize when using multiline label

  17. 17

    Multiline Label within UITableViewCell not working with iOS 9 or Swift 2.0

  18. 18

    Self sizing cell with multiple labels does not show multiline label

  19. 19

    Can't autoresize cell in table view with multiline label

  20. 20

    display multiline/multiple characters as key label on soft keyboard keys

  21. 21

    Java regex to match multiline records starting with fixed label

  22. 22

    Multiline Label within UITableViewCell not working with iOS 9 or Swift 2.0

  23. 23

    iOS7 - Adjusting font size of multiline label to fit its frame

  24. 24

    How to add background line in multiline label using NSAttributedString in ios objective-c

  25. 25

    UIStackView not displaying

  26. 26

    UIStackView embedded within UIStackView alignment

  27. 27

    UIStackView : Change UIStackView image width using storyboard

  28. 28

    Multiline Radiobutton

  29. 29

    regex in multiline

HotTag

Archive