0

enter image description here

Here you can see the black font is larger than its parent view. The height remains 21,5 of the UILabel, no matter what language I use.

I did: -add a UIView, center it X and Y. -Add a UILabel into it, set trailing, leading, bottom and top to 0. -Set the UILabel lines to 0 according to this post: https://stackoverflow.com/a/34430402/7715250

But it did not work. How can the UIView/UILabel increases when using a tall language and decreases when using a smaller language?

Community
  • 1
  • 1
J. Doe
  • 9,757
  • 4
  • 42
  • 83
  • 1
    What is the vertical compression resistance priority on the UILabel? Try setting it to "Required". – Misha Karpenko Aug 17 '17 at 20:15
  • @MishaKarpenko I setted everything to 1 and to 999, did not work – J. Doe Aug 17 '17 at 20:20
  • Have you tried calling `sizeToFit` on the UILabel? – Misha Karpenko Aug 17 '17 at 20:21
  • You should follow Misha's suggestion for the label and it's parent view as well. The label has fixed distances to it's superview. Can the Superview get bigger? – clemens Aug 19 '17 at 13:46
  • @macmoonshine it is not necessary about the parent view, it is about the uilabel. It does not grow, no matter what hugging or compression I set. – J. Doe Aug 19 '17 at 14:49
  • I'm not sure about that. You wrote _set trailing, leading, bottom and top to 0_. This may force the label to fixed height. If you want better help, you should give more detailed information. – clemens Aug 20 '17 at 08:57
  • @macmoonshine I mean without using a UIView, so only a UILabel, the height never increases from the UILabel. – J. Doe Aug 20 '17 at 12:22

0 Answers0