How to set top-left alignment for UILabel for iOS application?

后端 未结 21 1450
傲寒
傲寒 2020-12-04 07:54

I have added one label in my nib file, then its required to have top-left alignment for that lable. As I am providing text at runtime so its not sure that how much lines the

21条回答
  •  -上瘾入骨i
    2020-12-04 08:15

    If what you need is non-editable text that by default starts at the top left corner you can simply use a Text View instead of a label and then set its state to non-editable, like this:

    textview.isEditable = false
    

    Way easier than messing with the labels...

    Cheers!

提交回复
热议问题