簡體   English   中英

UILabel調整字體以適合文本

[英]UILabel Adjust Font to Fit text

我收到此代碼的錯誤

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

錯誤就在這一行

cell.label.adjustsFontSizeToFitWidth

錯誤是

The Expression resolves to an unused I-value

需要修復

替換這個:

cell.label.adjustsFontSizeToFitWidth

有了這個:

cell.label.adjustsFontSizeToFitWidth = true

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM