简体   繁体   中英

UILabel Adjust Font to Fit text

I'm getting an error for this code

cell.label.numberOfLines = 2
cell.label.text = adjust1
cell.label.font = UIFont.systemFontOfSize(12.0)
cell.label.adjustsFontSizeToFitWidth

The Error is at this line

cell.label.adjustsFontSizeToFitWidth

The Error is

The Expression resolves to an unused I-value

Need a fix

Replace this:

cell.label.adjustsFontSizeToFitWidth

with this:

cell.label.adjustsFontSizeToFitWidth = true

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