我使用以下代码行设置按钮的标题:
self.timerButton.setTitle(String(Int(duration)), for: .normal)
该按钮最大为屏幕的1/3,文本大小为60,在我以前的项目中还可以,但是现在
duration
的值发生了变化(从120〜0),该文本经常显示...
,有时即使是一半的数字,这怎么了?这是调试器中显示的约束:

最佳答案
试试这个可能对您有帮助:
self.timerButton.titleLabel?.adjustsFontSizeToFitWidth = true
关于ios - UIButton标签显示三个点,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41631528/