UILabel auto resize on basis of text to be shown

后端 未结 10 1905
余生分开走
余生分开走 2021-01-29 22:44

I\'m working on an application, in which I\'m required to autoresize the text area on basis of text to be displayed.

Firstly, I\'m not sure for this either I should use

10条回答
  •  心在旅途
    2021-01-29 23:20

    I'm not sure I totally understand the question, but you can use the sizeToFit method on a UILabel (the method is inherited from UIView) to change the size according to the label text.

提交回复
热议问题