为不同的Size类设置不同的位置和约束

时间:2015-08-20 05:50:20

标签: ios objective-c storyboard autolayout size-classes

我在大小课上有点困惑。我已经创建了一个项目,我想要wCompact hAnywCompact hRegular的不同位置。

我使用故事板设计了UI,并为这些尺寸类设置了不同的位置。每个Size类都安装了不同的约束,但是当我运行它时它不会给我想要的输出。我附上了一些图片,请看到这个并给我回答我做错了或错过的地方。

constraints for wCompact hAny this is the position for wCompact hAny constraints for wCompact hRegular Position for wCompact hRegular output in iphone4 output in iPhone 6+

1 个答案:

答案 0 :(得分:0)

在应用Constraints之前设置wCompact hAny和wCompact hRegular UIViewController.But选择来自Attributed Inspector的大小,因为我们不熟悉wCompact hAny和wCompact hRegular的大小,但是在选择大小后我们就会知道iPhone大小。

enter image description here

不应用中心水平和垂直于超级视图。并根据要求设置高度和宽度。

enter image description here