最佳答案
所以对于Y,如果你将图像的顶部设置为等于0的常量到superView的顶部。然后输入此代码:
@IBOutlet weak var topc: NSLayoutConstraint!
let heightOfSuperview = self.view.bounds.height
topc.constant = heightOfSuperview * 0.90 // this has the same effect as multiplier
这相当于 Center.y 乘数 = 0.9:1
关于ios - 以编程方式更改中心 X/Y 对齐约束的乘数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34912068/