gpt4 book ai didi

ios - 带有属性文本的 UIButton 不遵守 adjustsFontSizeToFitWidth

转载 作者:可可西里 更新时间:2023-11-01 06:13:46 24 4
gpt4 key购买 nike

关于为什么在 IB 上设置了属性文本的 UIButton 不遵守 adjustsFontSizeToFitWidth 的任何想法。

 button.titleLabel?.numberOfLines = 3
button.titleLabel?.adjustsFontSizeToFitWidth = true
button.titleLabel?.lineBreakMode = .//tried all options here....
button.titleLabel?.minimumScaleFactor = 0.2

最佳答案

adjustsFontSizeToFitWidth 不适用于属性字符串,您必须自己手动设置适当的字体大小

关于ios - 带有属性文本的 UIButton 不遵守 adjustsFontSizeToFitWidth,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37232855/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com