有时自动布局约束会捕捉到错误的锚点 - 就像我希望将控件锚定到其上方的控件并且自动布局约束锚定到窗口底部时.有没有办法移动约束?ASCII艺术应该使这更清楚.这就是我所拥有的:
+------------------------+
| |
| [x] Some checkbox |
| |
| [x] Another checkbox |
| | |
| | ? autolayout |
| | constraint |
| | |
+-----+------------------+
Run Code Online (Sandbox Code Playgroud)
这就是我想要的:
+------------------------+
| |
| [x] Some checkbox |
| | ? A.C. |
| [x] Another checkbox |
| |
| |
| |
| |
+------------------------+
Run Code Online (Sandbox Code Playgroud)
我可以通过向上移动下方的复选框将约束锚定到上部复选框,但这不是我想要的,我希望垂直空间更大.(复选框仅用于说明,我的真实用例有不同的视图.)