Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimum Font Size deprecated on ios version 6.0

I just upgraded to xcode 4.5 with iOS 6.0 and it's highlighting a warning on all the UILabels in my XIB files saying "minimum font size deprecated on ios version 6.0". Does anyone know what this is referring to and how to fix it?

Update: image is no more available (was at https://skitch.com/hahmadi82/eyk51/cloud)

like image 473
Hooman Ahmadi Avatar asked Jun 12 '12 21:06

Hooman Ahmadi


People also ask

What is the smallest text size?

Anything smaller than 5 pt will be extremely difficult to read, unless it's all capitalized. Even then, 4 pt font is about the smallest you can go. Keep in mind that some typefaces have thinner or lighter font weights, so just because one font is legible in 5 pt doesn't necessarily mean another one will be.

What is Minimumscalefactor?

Sets the minimum amount that text in this view scales down to fit in the available space. iOS 13.0+ iPadOS 13.0+ macOS 10.15+ Mac Catalyst 13.0+ tvOS 13.0+ watchOS 6.0+

How do I change font size in swift label?

To change the font or the size of a UILabel in a Storyboard or . XIB file, open it in the interface builder. Select the label and then open up the Attribute Inspector (CMD + Option + 5). Select the button on the font box and then you can change your text size or font.


1 Answers

minimumFontSize property of the UILabel is deprecated from iOS 6.0 onwards.

An Alternative to the minimumFontSize is minimumScaleFactor. If you assign minimumFontSize/defaultFontSize to minimumScaleFactor, it works in the same way as minimumFontSize.

The Code is as follows - For Example the font size is 30.0 and if you want the minimum font size to be 12.0

YOURLABEL.font= [UIFont fontWithName:@"FONT_NAME" size:30.0]; [YOURLABEL setMinimumScaleFactor:12.0/[UIFont labelFontSize]]; 
like image 101
Manju Avatar answered Oct 12 '22 15:10

Manju