需求: label大小不变,内容随着1~1000000等字体变小。
label初始值为10,设置minimumScaleFactor=0.5,就代表最小字体为5。adjustsFontSizeToFitWidth属性默认是NO,需要设置YES。
UILabel *littleSun=[[UILabel alloc]initWithFrame:CGRectMake(10, 0, 150, 15)];
littleSun=@"20170504";
littleSun=[UIFont systemFontOfSize:10];
timeLabel.adjustsFontSizeToFitWidth=YES;
timeLabel.minimumScaleFactor=0.5;