iOS:自动布局从左到右移动视图

时间:2014-06-20 07:26:31

标签: ios autolayout

我有3个视图,我希望使用自动布局约束来处理它们的布局。 肖像是这样的:

enter image description here

和景观应如下:

enter image description here

如何使用autolayout执行此操作?我尝试添加约束,但第三个视图(绿色),不会向上移动。它虽然在右侧移动。

我哪里出错了?我该如何解决?

1 个答案:

答案 0 :(得分:3)

可以使用大小类轻松完成,看一下apple doc Size Classes design help

此功能仅适用于xCode 6 New Features in xCode 6

Constraints in w**Any** h**Any** layout

Constraints in w**Any** h**Compact** layout

对其他布局保持相同的约束。

请注意,当前布局未安装灰色约束。

您可以在链接DownLoad Sample

中找到该示例