标签: ios autolayout constraints screen nslayoutconstraint
我在约束上浪费了几个小时,我仍然有问题 iPhone 6屏幕,它运行正常,但它无法在iPhone 5/4中运行。我设置所有视图(图像是背景)以修复W / H并点击自动添加缺失约束。
iPhone 6
正如你在iPhone 5上看到的那样,它始终是向右,有时向左。我无法添加任何错误。
有任何帮助吗?或者一些该死的好教程:)
答案 0 :(得分:1)
我只为一行按钮做了一个示例,因此可以将它们重用于其他UI元素。
我将这些约束放在我的按钮上:
LEFT BUTTON:
右键按钮
与两个按钮相关的约束: (您需要选择两个按钮才能应用关系约束)
在 Interface Builder 中,它看起来像这样:
这些布局是通用,因此我选择了一些设备尺寸:
iPhone 5
iPhone 6 Plus
......等等。