Vertically align UILabel

前端 未结 10 1570
故里飘歌
故里飘歌 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:55

    nice hack... my two cents for swift 4.2/5:

    self.optTextMessage.numberOfLines =  0
    self.optTitle.lineBreakMode  = .byWordWrapping
    

    and add \n.. as suggested..

提交回复
热议问题