[英]Swift constraint using multiplier working with trailing but not leading
Just change the leading Constrain of Score to Superview.Trailing instead of Superview.Leading : 只需将领先的分数约束更改为Superview.Trailing而不是Superview.Leading:
And then set the Score constraint multiplier to 6.27. 然后将“得分约束”乘数设置为6.27。 I will update the answer with the calculation I made shortly.
我将使用不久后进行的计算来更新答案。
UPDATE: 更新:
The multiplier of Score.Leading constant to Superview.Traling constant is : multiplier = View.width / (View.width - View.width / 1.2) Score.Leading常数与Superview.Traling常数的乘数为:乘数= View.width /(View.width-View.width / 1.2)
In my case the View width in iPhone X is 414 以我为例,iPhone X的“查看宽度”为414
414 / 1.2 = 345 414 / 1.2 = 345
414 - 345 = 69 414-345 = 69
414 / 69 = multiplier 414/69 =乘数
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.