Get truncated text from UILabel

后端 未结 3 876
北海茫月
北海茫月 2020-12-09 07:12

Is there anyway I can get the truncated version of the text for a UILabel?

In short, I have a paragraph of text, and two UILabels - label A, which is 2

3条回答
  •  旧时难觅i
    2020-12-09 07:32

    For Label A, calculate approximate character that should fit perfectly for two lines, for the particular font you are using.

    For label B, set variable Height that the whole text must fit into it.

提交回复
热议问题