ios – 如何/是否在Xcode中制作通用故事板

前端之家收集整理的这篇文章主要介绍了ios – 如何/是否在Xcode中制作通用故事板前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Xcode中创建故事板文件时,您必须选择是否适用于iPhone或iPad.这意味着应始终将iPhone和iPad UI放入单独的故事板中.这是真的?

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

因此,如果制作一个“通用”故事板,是否应该在Xcode中选择iPhone或iPad?有关系吗?

解决方法

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

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.

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)及更高版本.

猜你在找的iOS相关文章