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

ios – 如何是否在Xcode中制作通用故事板,第1张

概述在 Xcode中创建故事板文件时,您必须选择是否适用于iPhone或iPad.这意味着应始终将iPhone和iPad UI放入单独的故事板中.这是真的? 我的应用程序有多个故事板.虽然Main.storyboard文件在iPhone和iPad之间存在很大差异,但其他故事板几乎完全相同.唯一的区别可能是推动iPhone与iPhone上的popover,可以通过编程方式处理.制作两个故事板似乎非常愚蠢 在 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 – 如何/是否在Xcode中制作通用故事板全部内容,希望文章能够帮你解决ios – 如何/是否在Xcode中制作通用故事板所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1101257.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存