iOS Xcode 6 LaunchImage 名为“LaunchImage”的启动图像集没有任何适用的内容

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

iOS Xcode 6 LaunchImage The launch image set named "LaunchImage" did not have any applicable content

iosobjective-cxcodexcasset

提问by noobsmcgoobs

I deleted my original launchImage image set.

我删除了我原来的 launchImage 图像集。

Then went to "App Icons and Launch Images" in the project section of Xcode.

然后转到 Xcode 项目部分中的“App Icons and Launch Images”。

I de-selected "Launch Image Source" and then reselected it. I get the "Migrate launch images to an asset catalog". I choose an asset catalog and "Migrate" and then a launchImage image set opens up.

我取消选择“启动图像源”,然后重新选择它。我得到“将启动图像迁移到资产目录”。我选择一个资产目录和“迁移”,然后一个 launchImage 图像集打开。

I add my files, but then I get a red compile warning.

我添加了我的文件,但随后我收到了一个红色的编译警告。

I checked the Plist - no launchimage in there at all.

我检查了 Plist - 那里根本没有启动图像。

Previously, I got yellow warnings about Ambiguous content and the files being the wrong sizes - I check and rechecked - they were the right sizes!

以前,我收到了关于内容不明确和文件大小错误的黄色警告 - 我检查并重新检查 - 它们是正确的大小!

How do I fix?

我该如何解决?

EDIT: I found this in my files. Do I just trash the selected folder?

编辑:我在我的文件中找到了这个。我只是删除选定的文件夹吗?

ios file folder with 2nd images folder

带有第二个图像文件夹的 ios 文件夹

回答by Michael Olenick

Go to the project explorer and select the project. Click "Build Phases". At the bottom there's a section called "Copy Bundle Resources." I suspect you'll find two images.xcassets files there and, if so, remove one by highlighting and clicking the minus icon (there are legitimate reasons to have two, or more, but you'd have purposefully done that so it's outside the scope of this answer). On the remaining one add your images to the LaunchImage.

转到项目资源管理器并选择项目。单击“构建阶段”。在底部有一个名为“复制捆绑资源”的部分。我怀疑你会在那里找到两个 images.xcassets 文件,如果是这样,通过突出显示并单击减号图标来删除一个(有两个或更多的合法理由,但你是故意这样做的,所以它不在本答案的范围)。在剩下的一个上,将您的图像添加到 LaunchImage。

Your reason for adding two isn't clear so I'll add that if you are using multiple targets you can have different images.xcassets files for each target (xcode adds multiples by default). However, if most assets are the same and you don't want to manage multiples, you can use the same in all targets and write add a script to build phases to copy the different assets, like the launch image, over at compile time. This is also done in build phases: add a phase that runs a script then a copy (cp) line to copy images. Needless to say you should do this with very few assets: I use it for launch images and app icons.

您添加两个的原因尚不清楚,因此我将补充说,如果您使用多个目标,您可以为每个目标使用不同的 images.xcassets 文件(默认情况下 xcode 添加多个)。但是,如果大多数资产是相同的并且您不想管理多个资产,则可以在所有目标中使用相同的资产并编写添加脚本来构建阶段以在编译时复制不同的资产,例如启动图像。这也在构建阶段完成:添加一个运行脚本的阶段,然后添加一个复制 (cp) 行来复制图像。毋庸置疑,您应该使用很少的资产来做到这一点:我将它用于启动图像和应用程序图标。

Edited to add: there's a new scheme where launch images are in storyboards and/or xib's. I'm assuming that you're not using it because you said you were using the older launch images but, if you are, then just put your launch image in the storyboard/xib launch image file.

编辑添加:有一个新方案,其中启动图像位于故事板和/或 xib 中。我假设您没有使用它,因为您说您使用的是较旧的启动图像,但是,如果是,那么只需将您的启动图像放在 storyboard/xib 启动图像文件中。

回答by Dhaivat Vyas

Hi as per your question please visit the below link:
EDIT: I have tried to regenerate the issue which you are facing. please check your 'images.xcassets' you need to have both 'Launchimage' and 'AppIcon' in 'images.xcassets'. If you don't have either 'LaunchImage' or 'AppIcon' it will generate error.
Based on the image you have added it seems you have deleted image.xcassets from application but not moved to thrash.
You can follow the below image to set launch screen images.
1.) Before entering launch image in images.xcassets
enter image description here2.) images.xcassets without launch screen image
enter image description here3.) Add launch screen image in images.xcassets
enter image description here4.) Set launch image in launch Image screen
enter image description here

您好,根据您的问题,请访问以下链接:
编辑:我已尝试重新生成您面临的问题。请检查您的“images.xcassets”,您需要在“images.xcassets”中同时包含“Launchimage”和“AppIcon”。如果您没有“LaunchImage”或“AppIcon”,它将产生错误。
根据您添加的图像,您似乎已从应用程序中删除了 image.xcassets,但并未移至 thrash。
您可以按照下图设置启动屏幕图像。
1.) 在images.xcassets 中输入启动图像之前
在此处输入图片说明2.) 没有启动屏幕图像的images.xcassets
在此处输入图片说明3.) 在images.xcassets 中添加启动屏幕图像
在此处输入图片说明4.) 在启动图像屏幕中设置启动图像
在此处输入图片说明

This will help you to add new 'image.xcassets' in your application.
http://www.intertech.com/Blog/xcode-assets-xcassets/
5.) Folder structure after adding new image xcasset
enter image description here6.) Launched the application after deleting and adding new image assets.
enter image description hereThis will help you if you have removed just launch image from your 'images.xcassets' not your images.xcassets.
How to use Image.xcassets:
To set launch screen image and other images in your application.
https://www.youtube.com/watch?v=_36Y6rDcKP0&list=PLXCowKcXAVgrCe2Lezv0acRf4adQLshv2

这将帮助您在应用程序中添加新的“image.xcassets”。
http://www.intertech.com/Blog/xcode-assets-xcassets/
5.) 添加新图像 xcasset 后的文件夹结构
在此处输入图片说明6.) 删除和添加新图像资产后启动应用程序。
在此处输入图片说明如果您从“images.xcassets”而不是images.xcassets 中删除了刚刚启动的图像,这将对您有所帮助。
如何使用 Image.xcassets:
在您的应用程序中设置启动屏幕图像和其他图像。
https://www.youtube.com/watch?v=_36Y6rDcKP0&list=PLXCowKcXA​​VgrCe2Lezv0acRf4adQLshv2

Hope this will be more helpful.

希望这会更有帮助。