当在Xcode 6中对superview边缘进行水平布局时,如何摆脱-16? [英] How do I get rid of the -16 when doing horizontal layout to the edge of the superview in Xcode 6?

查看:166
本文介绍了当在Xcode 6中对superview边缘进行水平布局时,如何摆脱-16?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您尝试在Xcode 6故事板中将视图布局到其超级视图的边缘时,生成的约束具有-16的常量。为什么会这样,如何将其恢复为0?

When you try to layout a view to the edge of its super view in Xcode 6 storyboards the constraint that is generated has a constant of -16. Why is this, and how can I make it back to 0?

推荐答案

-16是因为约束是针对 Superview.trailing / leading Margin 不是superview的优势。您可以通过选择约束来解决此问题,并在右上角的信息中选择superview项目的下拉列表,并将相对于margin 切换为off。

The -16 is because the constraint is set against the Superview.trailing/leading Margin not the edge of the superview. You can fix this by selecting the constraint and in the info in the top right select the drop down for the superview item and toggle the relative to margin to off.

这篇关于当在Xcode 6中对superview边缘进行水平布局时,如何摆脱-16?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆