Minimum Font Size deprecated on ios version 6.0

IosXcodeUilabelDeprecatedFont Size

Ios Problem Overview


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)

Ios Solutions


Solution 1 - Ios

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]];

Solution 2 - Ios

Use minimumScaleFactor instead... Link

Solution 3 - Ios

Quick fix...Here minimum font size to be 8.0

            CGFloat size = textLabel.font.pointSize;// font size of label text
            [textLabel setMinimumScaleFactor:8.0/size];

Solution 4 - Ios

I am answering very late, but might help any other. As every one knows that setMinimumFontSize has been deprecated, so other method replacing setMinimumFontSize is setAdjustFontToFitWidth which takes BOOL e.g

[yourLabel setAdjustsFontSizeToFitWidth:YES];
//or
yourLabel.adjustsFontSizeToFitWidth = YES;

Solution 5 - Ios

For Swift use the following:

//set the number (ex. 8 to your desired minimum font size)
myLabel!.minimumScaleFactor = 8/myLabel!.font.pointSize;`

Works like a charm!

Solution 6 - Ios

I had similar problem. Quick fix is to use MinimumScaleFactor property of UILabel.

Solution 7 - Ios

Go into finder and find the .storyboard file or your .xib and open with TextEdit. Use find to locate the string "autoshrinkMode" and replace the value "minimumFontSize" to "minimumFontScale"

Odd that the conversion wasn't written in the update scripts...

Also credit to @Rob in the comments above for stating the same answer. He should receive credit for this one.

Solution 8 - Ios

You can use minimum scale factor over there or drag a lable and set autoshrik-> minimum font.

Maybe this can help you.

Solution 9 - Ios

Yes minumumFontSize is deprecated.

Use following minimumScaleFactor:-

Obj.minimumScaleFactor= (floatValue);

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionHooman AhmadiView Question on Stackoverflow
Solution 1 - IosManjuView Answer on Stackoverflow
Solution 2 - IosAravind NCView Answer on Stackoverflow
Solution 3 - IosSabareeshView Answer on Stackoverflow
Solution 4 - IosSyed Ali SalmanView Answer on Stackoverflow
Solution 5 - IosChris KlinglerView Answer on Stackoverflow
Solution 6 - IosJayprakash DubeyView Answer on Stackoverflow
Solution 7 - IosSnareChopsView Answer on Stackoverflow
Solution 8 - IosshreejiView Answer on Stackoverflow
Solution 9 - IosGauravView Answer on Stackoverflow