Mace21
Mace21

Reputation: 13

IOS How to increase font size depending on display size

I want the font sizes within my UILabels to increase in size depending on the screen size of the device running the app. In the IOS simulator, when I run my app on an iPad,the text is the same size as on an iPhone 4-inch.

I've tried auto-resizing the UILabels and then increasing the font size within those labels programmatically, but I can't figure it out.

Appreciate the help!

Upvotes: 1

Views: 1902

Answers (1)

user
user

Reputation: 633

In your storyboard 1. Add aspect ratio to your label's constraints 2. Enable auto shrink (minimum font size or minimum font scale) 3. Set your label's font size to the max value you want it to appear when the display gets bigger, the font will automatically shrink if your frame is small and will get bigger if the frame is larger

Upvotes: 1

Related Questions