iOS 7中的大小类 [英] Size Classes in iOS 7

查看:126
本文介绍了iOS 7中的大小类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Size Classes在Xcode 6中创建了一个新的应用程序。在使用iOS 7进行测试后,我无法弄清楚如何让iPhone在横向模式下显示特定尺寸等级。

I created a new app in Xcode 6 using Size Classes. After testing with iOS 7, I can't figure out how to get iPhone to display a certain size class while in landscape mode.

我首先使用iPhone横向开发了UI作为wAny hCompact,但iOS 7无法识别。我在wAny hAny中有iPhone肖像。

I first developed the UI with iPhone landscape as wAny hCompact, but iOS 7 doesn't recognize that. I had iPhone portrait in wAny hAny.

然后我改变它,所以现在我正在使用wCompact hRegular for iPhone portrait。然后我修改了wAny hAny作为横向布局。但是当iOS 7设备处于横向状态时,它不会使用该布局。

I then changed it so now I'm using wCompact hRegular for iPhone portrait. I then modified wAny hAny to be the landscape layout. But it's not using that layout when the iOS 7 device is in landscape.

iOS 7是否能够根据设备的纵向或横向使用不同的大小类?如果是这样,我应该使用哪个尺寸类?

Is iOS 7 able to use different size classes based on the device being portrait or landscape? If so, which size class should I be using?

参考:关于向后兼容大小类的真正有用的信息。

ps。我并不关心iPad,因为根据iOS 8中的设备旋转,设备不会显示不同的大小类。

ps. I'm not concerned with iPad because the device does not display a different size class based on the device rotation in iOS 8.

推荐答案

尺寸类肯定适用于iOS 7。但只有遵循以下几条规则:

Size classes works in iOS 7 for sure. But only if you follow several rules:


  • 该应用程序是使用Xcode版本 6 或更高版本构建的

  • 该应用的部署目标是早于iOS 8

  • 在故事板或xib文件中指定大小类

  • 高度组件的值不紧凑(是的,这是你的情况,在iOS 7中是不可能的,不幸的是

  • The app is built using Xcode version 6 or later
  • The deployment target of the app is earlier than iOS 8
  • Size classes are specified in a storyboard or xib file
  • The value of the height component is not compact (yep, this is your case, it's not possible in iOS 7, unfortunatelly)

这里有一点解释: https://stackoverflow.com/a / 24976792/2190175

这篇关于iOS 7中的大小类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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