How scale fontsize for change size of UILabel
My width and height scaling relative interfaceOrientation, but i can't scale fontSize of my UILabel.
my_label.a开发者_开发技巧djustsFontSizeToFitWidth = YES;
won't work for me.
Make sure your my_label.minimumFontSize
is less than the my_label.font.pointSize
.
You could try something like:
my_label.minimumFontSize = (my_label.font.pointSize / 4.0) * 3.0;
my_label.adjustsFontSizeToFitWidth = YES;
Or set the values in the Interface Builder for Minimum Font Size to something smaller then the Font Size. This way if the label is reduced in width, it will scale the font size down.
精彩评论