【发布时间】:2016-09-10 23:59:28
【问题描述】:
关于为什么在 IB 上设置属性文本的 UIButton 不尊重 adjustsFontSizeToFitWidth 的任何想法。
button.titleLabel?.numberOfLines = 3
button.titleLabel?.adjustsFontSizeToFitWidth = true
button.titleLabel?.lineBreakMode = .//tried all options here....
button.titleLabel?.minimumScaleFactor = 0.2
【问题讨论】:
-
你试过这个按钮吗?titleLabel?.lineBreakMode = NSLineBreakByClipping;
-
你在哪里为按钮设置文本
-
界面生成器。
-
在帖子中查看图片。您确定第一行与您的 uibutton 成比例地“增长”吗?我没有得到同样的效果......
-
我知道...我在问你是如何用 3 行写的