How to render stretched text in iOS?

前端 未结 3 856
醉梦人生
醉梦人生 2020-12-23 23:51

Given a rectangular area, I want to render some text using a specific font and have the rendered text fill out the rectangle. As in the image below:

3条回答
  •  孤城傲影
    2020-12-24 00:14

    you can also try with the UILabel's @property(nonatomic) BOOL adjustsFontSizeToFitWidth and @property minimumFontSize

    Initially you can set the much higher value for font property and also initialize the minimumFontSize with a minimum font value.

提交回复
热议问题