Vertically align UILabel

前端 未结 10 1532
故里飘歌
故里飘歌 2020-12-31 10:34

I am trying to vertically align the text in the UILabel view of my app. The problem is that I want the text to be vertically aligned to the top and the size of the label to

10条回答
  •  有刺的猬
    2020-12-31 10:50

    You can make it with a constraint on the interface builder.

    1. Put the number of lines that you want
    2. Create a constraint with an height enough bigger for 3 lines and in relation section put "Less Than or Equal".

    Hope this help you !

提交回复
热议问题