适用于iPad纵向和横向iOS8的自动布局 [英] Autolayout for iPad portrait and landscape separately iOS8

查看:49
本文介绍了适用于iPad纵向和横向iOS8的自动布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个视图上大约有3或4个按钮.它们具有垂直间隔.我想要这样的东西:

I have about 3 or 4 buttons on a view. They have vertical spacing. I want something like this:

纵向 这些间距= 100

In portrait those spacings = 100

在景观中,这些间距= 200

In landscape those spacings = 200

如何通过Interface Builder使用自动布局实现这一目标

How can I achieve this with autolayout by Interface Builder

推荐答案

在IB中,将大小类wRhR大小类用于ipad.对于iPad,横向模式和纵向模式没有单独的尺寸类别.您可以通过使用网点进行预防性操作.

In IB use size class wRhR size class for ipad. For iPad there is no separate size class for landscape mode and portrait mode. You can do it using progarmatically using outlets.

如果您在代码中覆盖特征集合并覆盖任何与您相关的大小类,则可以在IB中做到这一点.

There is way to do it in IB if you override trait collections in your code and override any size class relevant to you.

这篇关于适用于iPad纵向和横向iOS8的自动布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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