I am doing a photo application with some editing options so I have a UIView and it is resizable and in that UIView I have UILabel with the UIView bounds as rect. I want to increase the font of text when I resize the view. I tried sizeToFit,factLabel.adjustsFontSizeToFitWidth as TRUE but its not working I want to fill the text to its frame. can anyone help me on this.
Asked
Active
Viewed 1,723 times
3 Answers
1
In Storyboard, go to the label's attributes inspector. You should make the font VERY big (think hundreds of points), and in the "Autoshrink" section choose a minimum font size (as small as you want).

Arik Segal
- 2,963
- 2
- 17
- 29
0
I think you just need to add this:
label.adjustsFontSizeToFitWidth = YES; label.minimumFontSize = 0;
Then the text will automatically resize to fit the label.

Vandana pansuria
- 764
- 6
- 14
-
I already used this but it will FIT the text font to its frame but I want to FILL the text to its frame. – Uttam Dec 07 '16 at 12:11
-
I am looking to fill the text to the frame size like all borders of the text should be filled in the frame – Uttam Dec 07 '16 at 12:21