Post

Replies

Boosts

Views

Activity

adjustsFontSizeToFitWidth working different on iOS 14 vz 15
Im observing a bigger down size of my text when using .adjustsFontSizeToFitWidth on iOS15 vz iOS14 Xcode 13 but i haven't find any release notes explaining why. My observations are this: Same frame for the label result on a different text size in a proportion of heiht: 1, width:4 even more stranger if I increase the height of the frame the behavior returns to be like the old one and this don't affect behavior on iOS14 // First label is render smaller on iOS 15 vz 14 UILabel *yourLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 100, 160, 40)]; [yourLabel1 setTextColor:[UIColor brownColor]]; [yourLabel1 setBackgroundColor:[UIColor systemRedColor]]; [yourLabel1 setFont:[UIFont boldSystemFontOfSize:52]]; [yourLabel1 setText:@"HELLO"]; yourLabel1.minimumScaleFactor = 0.2; yourLabel1.adjustsFontSizeToFitWidth = YES; [self.view addSubview:yourLabel1]; // Second label is render equal on iOS 15 and 14 only difference is a change on the height UILabel *yourLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(0, 300, 160, 60)]; [yourLabel2 setTextColor:[UIColor brownColor]]; [yourLabel2 setBackgroundColor:[UIColor systemRedColor]]; [yourLabel2 setFont:[UIFont boldSystemFontOfSize:52]]; [yourLabel2 setText:@"HELLO"]; yourLabel2.minimumScaleFactor = 0.2; yourLabel2.adjustsFontSizeToFitWidth = YES; [self.view addSubview:yourLabel2];
0
0
1.5k
Jul ’22