使用故事板中的自动布局更改横向视图框架

问题描述:

我对AutoLayout很新。我有一个问题。将窗体纵向移动到横向模式时,我需要更改任何UIView的框架。使用故事板中的自动布局更改横向视图框架

例如:如果我在肖像模式下有一个UILabel与框架(100,100,100,30)。如果将iPad旋转到横向模式,我想将其框架更改为(400,400,100,30)。我想使用故事板和自动布局来做到这一点。

我想避免为此编码。

我试试这个:

首先检查使用自动版式

enter image description here

将鼠标指向UILabelCtrl键键拖动右侧,选择尾随空间容器

enter image description here

将鼠标指向UILabel和阻力左侧Ctrl键并选择集装箱

enter image description here

前导空格这是你的输出:

enter image description hereenter image description here

检查它。 :)

这将帮助你在自动布局 请参阅下面给出的图像

 Apply the process with screen shot 1

Apply the process with screen shot 2

Apply the process with screen shot 3

+0

你需要解释你的答案。 – Sats 2014-09-24 07:18:32