在Xcode 6 beta中使用大小类 [英] Use Size Classes in Xcode 6 beta

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

问题描述

在Xcode 6(Beta 1)中从Swift开始构建一个新项目,并参见Storyboard的File Inspector。 使用大小类 使用自动布局。这是截图。

Built a new project from scratch in Swift in Xcode 6 (Beta 1) and see File Inspector of Storyboard. There is Use Size Classes below Use Auto Layout. This is the screenshot of this.

1)什么是使用大小类

2)它与iPhone 6屏幕尺寸有关吗?

2) Is it related with iPhone 6 screen size?

推荐答案

尺寸类让你创建一个故事板而不管它是什么设备。带来 自适应布局 的喜悦(不同画布尺寸的布局而不是特定设备,可以 紧凑 常规 )更常见的是针对所有设备的单个应用。现在专注于抽象地设计您的设计,就像使用通用设备一样。

Size classes let's you create a single storyboard irrespective of the device. Brings the joy of adaptive layouts(layouts for different canvas sizes instead of specific device, could be compact or regular) More generally a single app for all devices. Now focus on laying out your design abstractly as if for a generic device.

来自 Xcode中的新内容


大小类



iOS 8的大小类可以设计一个带有iPhone和iPad自定义布局的通用故事板。使用大小类,您可以定义一次公共视图和约束,然后为每个支持的形状因子添加变体。 iOS模拟器和资产目录也完全支持大小类。

Size classes

Size classes for iOS 8 enable designing a single universal storyboard with customized layouts for both iPhone and iPad. With size classes you can define common views and constraints once, and then add variations for each supported form factor. iOS Simulator and asset catalogs fully support size classes as well.

基本上你只想为所有版面iPhone3.5创建一个故事板,iPhone4,iPhone6(谁知道它的大小),iPad ......你甚至可以为特定尺寸的设备设计单独的布局,但你不会创建第二个故事板。在Interface Builder画布上的任意宽度|中布置用户界面项时任何高度组合,布局适用于您的应用所针对的所有尺寸的设备。

Essentially you just want to create a single storyboard for all layouts iPhone3.5",iPhone4",iPhone6(who knows its size), iPad... You can even design separate layouts for a specific size devices but you are not gonna create a second storyboard. When you lay out user interface items on the Interface Builder canvas in the Any Width | Any Height combination, the layout applies to all sizes of devices for which your app targets.

有关详细信息:尺寸等级设计帮助

注意:尺寸等级在iOS7中也能正常工作。我刚刚在iOS7模拟器上测试过它。如果您有任何设备问题,请告诉我,我会更新我的答案。

NB: Size class is working fine in iOS7 also. I just tested it on iOS7 simulators. If you have any problems in device let me know i will update my answer.

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

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