简体   繁体   中英

changing system font size programatically in IOS

I want to know whether it's possible to scale font size in IOS devices programatically. If so can anyoone possibly provide a code to do that?

nameLabel.font = UIFont.systemFont(ofSize: 16) -> Returns an instance of the system font for the specified text style and scaled appropriately for the user's selected content size category.

this can be useful too:

detailLabel.numberOfLines = 0 -> text don't get stuck in 1 line

label.adjustsFontSizeToFitWidth = true -> A Boolean value indicating whether the font size should be reduced in order to fit the title string into the label's bounding rectangle.

label.adjustsFontForContentSizeCategory = true -> A Boolean value indicating whether the object automatically updates its font when the device's content size category changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM