Tuesday, October 20, 2015

set label minimum font size IOS 6 and above dynamically


For changing the font scale of the label earlier we used to use a code like this

myLabel.minimumFontSize = 24;  


myLabel is the label and the minimumFontSize we want is 24.

This gives a warning saying "minimumFontSize first deprecated in ios 6".

the following is the appropriate code to do it post ios6.

[myLabel setMinimumScaleFactor:24.0/myLabel .font.pointSize];


Thanks,
Bob



No comments:

Post a Comment