Kobe Kobe - 1 year ago 42
iOS Question

How to shrink font only for a specific screen size

Based on the following image:

enter image description here

I want the green and red text to shrink for the 4 inch screen size, but not for the 4.7 inch size.

What I did is set the

property to
Minimum Font Scale
- 0.7 and also changed the labels Lines property to 0.

Now the font shrinks for the 4 inch screen, but also for 4.7 one, which I don't want too. How do I prevent the text to shrink for a specific screen ?

Is there a way to do this using
Size Classes
? Or I have to do something in code to check for the specific screen size ?

Answer Source

You can't use Size Classes to distinguish iPhone 4 vs iPhone 4.7. Size Classes can only distinguish these cases (see picture below). You must check the specific screen size in you code enter image description here