Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Xcode 9 中,我如何设置约束,其中 0 点表示放置在蓝色虚线上而不是视图控制器的边缘。
我希望前缘和下缘的 0 分是这样的:
使用这样的约束参数:
不像这样:
根据我的理解,您不能将 0 设置为前导和底部的一些边距,正如您在主视图的问题中所描述的那样。
因此,如果您想实现这一点,您必须采用 UIView 并将所有三个按钮设为子视图,并为您的按钮消息设置约束 0。
对于相对项(在这种情况下是视图,而不是按钮),您必须选择Relative To Margin。 然后您应该能够将常量设置为0.
0