iPhone UILabel sizeWithFont:

后端 未结 5 1196
刺人心
刺人心 2020-12-09 06:37

I\'m trying to measure the visual size of a NSString that takes into account the number of lines I can render. However, sizeWithFont doesn\'t take into account numberOfLines

5条回答
  •  情话喂你
    2020-12-09 07:32

    The correct answer is, of course, you need to set numberOfLines to 0, which will cause the framework to compute the result with however many lines it needs. See also this question.

提交回复
热议问题