我如何为我的按钮创建一个约束,这样它就不会弄乱它的大小
How do i create a constraint for my button, so it wont mess up the size of it
我有一个按钮,我希望在所有设备上与屏幕边缘的距离相同,我在右边设置了一个约束,效果很好,但在底部它弄乱了我的按钮的大小。我尝试使用相同的约束将它变大,但它给我警告说尺寸在 运行 时会有所不同。
before i put the bottom (y) constraint
after the y constraint is added
with two constrains and after i stretch out resulting in misplaced view warnings
确保从按钮的前导侧到屏幕左侧也有一个常数为 0 的约束。然后,添加一个水平约束。
我有一个按钮,我希望在所有设备上与屏幕边缘的距离相同,我在右边设置了一个约束,效果很好,但在底部它弄乱了我的按钮的大小。我尝试使用相同的约束将它变大,但它给我警告说尺寸在 运行 时会有所不同。
before i put the bottom (y) constraint
after the y constraint is added
with two constrains and after i stretch out resulting in misplaced view warnings
确保从按钮的前导侧到屏幕左侧也有一个常数为 0 的约束。然后,添加一个水平约束。