I have created a UIlabel and UItextfield that correspond with each other. My new challenge is to have my font self-adjust its size to fill the UIlabel depending on how much text is entered. Solutions?
Asked
Active
Viewed 3,315 times
1 Answers
3
UILabel
has a property adjustsFontSizeToFitWidth
. Please refer to UILabel Class Reference.
UITextField
has a same one, see UITextField Class Reference.
You can set a big enough default font size and let the control reduce the text to fit the width. The actual font size will be between minimumFontSize
and the size setting of font
.

Hailei
- 42,163
- 6
- 44
- 69