Xcode 8 中的自适应布局

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38631327/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:05:20  来源:igfitidea点击:

Adaptive Layout in Xcode 8

iosxcodexcode8ios10adaptive-layout

提问by Khawar

I am developing app using Xcode 8 (beta 1). Unfortunately, I am not able to find "Size Classes" option.

我正在使用 Xcode 8 (beta 1) 开发应用程序。不幸的是,我找不到“Size Classes”选项。

In Xcode 7, there was option "Use Size Classes".

在 Xcode 7 中,有“使用大小类”选项。

enter image description here

在此处输入图片说明

But in Xcode 8 there is no such option. Is there any help for using Size Classes or similar in Xcode 8?

但是在 Xcode 8 中没有这样的选项。在 Xcode 8 中使用 Size Classes 或类似的有什么帮助吗?

回答by Bhumit Mehta

Now you have "Use Trait Variations" which is improved version of Size Classes

现在你有了“使用特征变化”,这是尺寸类的改进版本

enter image description here

在此处输入图片说明


You can now select device based and orientation based trait view much like size classes (iPad Pro, iPad, iPhone 6Splus, iPhone 6s, iPhone SE and iPhone 4s)


您现在可以选择基于设备和基于方向的特征视图,就像尺寸类别(iPad Pro、iPad、iPhone 6Splus、iPhone 6s、iPhone SE 和 iPhone 4s)

enter image description here

在此处输入图片说明

回答by Dhruv Khatri

Apple introduce new feature called Trait Variations.

Apple 推出了名为 Trait Variations 的新功能。

Trait Variation

特质变异

So now you can simply create how it looks on real device.

所以现在您可以简单地创建它在真实设备上的外观。

enter image description here

在此处输入图片说明

You can simply switch devices by just clicking and also change the orientation of your view.

您只需单击即可切换设备,还可以更改视图的方向。