[英]Button text appearing outside frame
I have a UIButton set up in the interface builder and I have the following code in the viewDidLoad()
method. 我在界面生成器中设置了UIButton,并且在
viewDidLoad()
方法中具有以下代码。
purchaseButtonOutlet.layer.cornerRadius = 8
purchaseButtonOutlet.titleLabel?.minimumScaleFactor = 0.01
purchaseButtonOutlet.titleLabel?.adjustsFontSizeToFitWidth = true
On bigger devices eg the iPad Pro, it works fine, but on smaller devices eg the iPhone SE, it doesn't work: 在较大的设备上,例如iPad Pro,它可以正常工作,但是在较小的设备上,例如iPhone SE,它不起作用:
Does anyone know why this is? 有人知道为什么是这样吗?
Try to set two constraints 尝试设置两个约束
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.