ios 启动图像或启动 xib / 故事板?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27998284/
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-08-31 04:23:44  来源:igfitidea点击:

Launch image or launch xib / storyboard?

iosxcodeios8xcode6

提问by temporary_user_name

I'm trying to finish my first iOS app up for submission and I'm just getting really confused here. The documentation is telling me I need a launch image and giving me the dimensions for iPhone 6 and 6+ but then clearly says in a couple places that "The launch XIB or storyboard is required to support iPhone 6 sized apps."

我正在尝试完成我的第一个 iOS 应用程序以供提交,但在这里我真的很困惑。文档告诉我我需要一个启动图像,并为我提供了 iPhone 6 和 6+ 的尺寸,但随后在几个地方明确指出“需要启动 XIB 或故事板来支持 iPhone 6 大小的应用程序。”

I'm confused to no end here. Why am I including launch images if I need a "launch storyboard"? I haven't even figured out what a launch storyboard is yet...

我在这里困惑到没有尽头。如果我需要“启动故事板”,为什么要包含启动图像?我什至还没有弄清楚发布故事板是什么......

采纳答案by Romain

If you're developing with Xcode 6 and for iOS 8 exclusively, then you should use launch storyboards, which avoid the need to provide several launch images at different sizes.

如果您专门使用 Xcode 6 和 iOS 8 进行开发,那么您应该使用启动故事板,这样就无需提供多个不同大小的启动图像。

This storyboard is automatically generated by Xcode 6 when starting a new project, but you might have been using an older project template.

这个故事板是在启动新项目时由 Xcode 6 自动生成的,但您可能一直在使用旧的项目模板。

See here for how to create a launch storyboard using Xcode 6: http://oleb.net/blog/2014/08/replacing-launch-images-with-storyboards/

请参阅此处了解如何使用 Xcode 6 创建启动故事板:http: //oleb.net/blog/2014/08/replacing-launch-images-with-storyboards/

Please note that you can also use a regular, "single" XIB file instead of a whole storyboard if you like. I think the Xcode 6 project templates use XIB files for that purpose.

请注意,如果您愿意,您也可以使用常规的“单个”XIB 文件而不是整个故事板。我认为 Xcode 6 项目模板为此目的使用 XIB 文件。

Unfortunately, if your app is also targeting older versions of iOS (even iOS 7), you'll have no other option than also including launch images for all iPhone devices (except iPhone 6, which doesn't run these versions of iOS, obviously). This is a pain, but Apple made the right move by providing this new feature for future developments.

不幸的是,如果您的应用程序还针对旧版本的 iOS(甚至是 iOS 7),您将别无选择,只能包含所有 iPhone 设备的启动图像(iPhone 6 除外,它显然不运行这些版本的 iOS) )。这很痛苦,但苹果为未来的发展提供了这项新功能,这是正确的举措。

回答by wcd

From your comment under @Romain's answer,

从您在@Romain 的回答下发表的评论中,

So to support everything, I need both.

所以为了支持一切,我需要两者。

No, if you need to support everything, use launch images. If your app ships with launch images and use them to display launch screen, then no need to provide launch xib/storyboard. An app can only use one way to display launch screen.

不,如果您需要支持所有内容,请使用启动图像。如果您的应用附带启动图像并使用它们来显示启动屏幕,则无需提供启动 xib/storyboard。一个应用程序只能使用一种方式来显示启动屏幕。