如何/是否在Xcode中制作通用故事板 [英] How/whether to make a universal storyboard in Xcode

查看:228
本文介绍了如何/是否在Xcode中制作通用故事板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Xcode中创建情节提要文件时,您必须选择是否适用于iPhone或iPad。这意味着应始终将iPhone和iPad UI放入单独的故事板中。这是真的吗?

When creating a storyboard file in Xcode, you must select if it is for iPhone or iPad. This implies one should always put iPhone and iPad UIs into separate storyboards. Is this true?

我的应用程序有多个故事板。虽然Main.storyboard文件在iPhone和iPad之间存在很大差异,但其他故事板几乎完全相同。唯一的区别可能是推动iPhone与iPhone上的popover,可以通过编程方式处理。制作两个故事板似乎非常愚蠢和冗余。

My app has multiple storyboards. While the Main.storyboard files largely differ between iPhone and iPad, other storyboards are nearly identical. The only difference might be segue being a push on iPhone vs popover on iPad, which can be handled programmatically. It seems awfully silly and redundant to make two storyboards.

因此,如果制作一个通用故事板,是否应该在Xcode中选择iPhone或iPad?是否重要?

So if making one "universal" storyboard, should iPhone or iPad be selected in Xcode? Does it matter?

推荐答案

从Xcode 6开始,我们可以为所有设备创建一个统一的故事板。
欲了解更多信息 - 文档

As of Xcode 6, we can create a single unified storyboard for all the devices. For more info - Documentation


iOS 8处理屏幕尺寸和方向更多
多才多艺。您可以比以往更轻松地为
创建一个适用于iPad和iPhone的应用程序,根据需要调整为
方向更改和不同的屏幕尺寸。使用通用界面设计应用程序
,然后针对不同大小的
类自定义它们。使您的用户界面适应每种形式
因子的优势。您不再需要创建特定的iPad故事板;
而是定位适当的大小类并调整你的界面
以获得最佳体验。

iOS 8 makes dealing with screen size and orientation much more versatile. It is easier than ever to create a single interface for your app that works well on both iPad and iPhone, adjusting to orientation changes and different screen sizes as needed. Design apps with a common interface and then customize them for different size classes. Adapt your user interface to the strengths of each form factor. You no longer need to create a specific iPad storyboard; instead target the appropriate size classes and tune your interface for the best experience.

iOS 8中有两种类型的大小类:常规紧凑。一个
的常规大小类表示大量的屏幕空间,例如iPad上的
,或者是一种普遍采用的范例,它提供了大量屏幕空间的
错觉,例如滚动
iPhone。每个设备都由一个大小类定义,垂直和水平
。 iPad尺寸类显示
iPad的原生尺寸等级。凭借可用的屏幕空间,iPad在垂直和水平方向上都有
普通尺寸等级,包括
纵向和横向。

There are two types of size classes in iOS 8: regular and compact. A regular size class denotes either a large amount of screen space, such as on an iPad, or a commonly adopted paradigm that provides the illusion of a large amount of screen space, such as scrolling on an iPhone. Every device is defined by a size class, both vertically and horizontally. iPad size classes shows the native size classes for the iPad. With the amount of screen space available, the iPad has a regular size class in the vertical and horizontal directions in both portrait and landscape orientations.

编辑:
它仅支持iOS 8(向后兼容仅适用于iOS 7)及更高版本。

It only supports iOS 8(backward compatible applies only for iOS 7) and later.

这篇关于如何/是否在Xcode中制作通用故事板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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