IOS10 after, as long as the application to join the corresponding application code can make the font size and synchronization, such shows on the Internet, various, but few give a instance, someone asked me how to set up, said no response, I tried and found nothing, looked at each other’s code, it is less a words:

Online adjustsFontForContentSizeCategory properties combined with a lot of criticism is that the preferredFontForTextStyle role being ignored by the amplification adjustsFontForContentSizeCategory easier, Both, in fact, whether adjustsFontForContentSizeCategory function is only open to adapt to the system font, is a Boolean variable, the real work is preferredFontForTextStyle.

Here’s an example for your reference, but only if you’re using Xcode8 and iOS10, which the emulator doesn’t support:

UILabel *titleLabel = [[UILabel alloc] init]; titleLabel.frame = CGRectMake(16, 100, 320-40, 100); titleLabel.font =[UIFont preferredFontForTextStyle:UIFontTextStyleBody]; titleLabel.adjustsFontForContentSizeCategory = YES; TitleLabel. Text = @ "UIFont preferredFontForTextStyle: meaning is to specify a style, and make the font size in line with the user to set the font size." ; titleLabel.numberOfLines = 0; titleLabel.backgroundColor = [UIColor clearColor]; [self.view addSubview:titleLabel];Copy the code