简体   繁体   中英

Adjust Font Size to Fit Bounding Rect?

I have a UILabel which has a defined frame:

let label = UILabel(frame: someFrame)

Is it possible that the font size will be adjusted to fit the height of the bounding Rect or fit the height and width of the bounding rect?

Set the label's font size to something absurdly large, then set the label's autoshrink to an absurdly small minimum font size. Now your label's font will always fit it's frame.

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