启动图像未在 Xcode 7 中显示

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

Launch images not showing with Xcode 7

iosiphonexcodeasset-cataloglaunchimage

提问by AppsDev

I have set the launch images in an asset catalog (LaunchImage), which I've also set in the target's "General" tab in Xcode. The default LaunchScreenfile was being shown when running the app, but I read this postand I did what it is said there: to left empty the Launch Screen Fileparameter both in "General" tab and in .plist

我已经在资产目录 ( LaunchImage) 中设置了启动图像,我也在 Xcode 中目标的“常规”选项卡中进行了设置。LaunchScreen运行应用程序时显示了默认文件,但我阅读了这篇文章,并按照那里所说的做了:将Launch Screen File“常规”选项卡和 .plist 中的参数留空

But now, instead of showing the appropiate launch image from catalog or the default one, I'm showing a black screen...

但是现在,我没有显示目录中的适当启动图像或默认图像,而是显示黑屏...

I'm supporting only iPhone, and iOS 7, 8 & 9.

我只支持 iPhone 和 iOS 7、8 和 9。

What could I be missing?

我可能会错过什么?

Thanks

谢谢

EDIT:could this be because of incorrect image sizes? For example, for the iPhone Portrait Retina HD 5.5 I have a file of size 1242 x 2208 and name [email protected], is that correct?

编辑:这可能是因为图像尺寸不正确吗?例如,对于 iPhone Portrait Retina HD 5.5,我有一个大小为 1242 x 2208 和 name 的文件,对[email protected]吗?

EDIT 2:This is what I have in the target's "General" tab. target settings

编辑 2:这是我在目标的“常规”选项卡中的内容。 目标设置

回答by Dhaivat Vyas

Well what I've noticed that when you create a new project by default you will get LaunchScreen.storyboardas you Launch Screen Image.

好吧,我注意到,当您默认创建一个新项目时,您将LaunchScreen.storyboardLaunch Screen Image 时获得

But if you don't want to use LaunchScreen.storyboardthen what you do is remove LaunchScreen.storyboardand tap on Use Asset Catalog.

但是,如果您不想使用,LaunchScreen.storyboard那么您要做的就是删除LaunchScreen.storyboard点击 Use Asset Catalog

But by default it will give you Brand Assetinstead of Launch Imagein Xcode Version 7.1.1.

但默认情况下,它会为您提供品牌资产,而不是Xcode 7.1.1 版中的启动图像

Now click on the arrow besides Brand Asses/Launch Image. Xcode will navigate you to Assets.xcasetsfolder.

现在单击Brand Asses/Launch Image 旁边的箭头。Xcode 将导航到Assets.xcasets文件夹。

Now click on +below to add App Icons & Launch Images.

现在单击下面的+添加应用程序图标和启动图像

From there you need to select New iOS Launch Image. enter image description here

从那里您需要选择New iOS Launch Image在此处输入图片说明

This is how your LaunchImageshould be visible. enter image description here

这就是您的LaunchImage应该如何可见。 在此处输入图片说明

Now add the images according to size specified in the Apple Documentation. You can also get Launch Image Size from this url: LaunchImageSize

现在根据 Apple 文档中指定的大小添加图像。您还可以从此 url 获取 Launch Image Size:LaunchImageSize

Now go application>Targets>Generaland in Launch Images Sourceselect LaunchImage. enter image description here

现在转到application>Targets>General并在Launch Images Source 中选择LaunchImage在此处输入图片说明

Here is the image with LaunchImageadded in Assets.xcassets. enter image description here

这是添加了LaunchImage的图像Assets.xcassets在此处输入图片说明

Simulator Image on launching App. enter image description here

启动应用程序时的模拟器图像。 在此处输入图片说明

Hope it helps in solving your problem.

希望它有助于解决您的问题。

回答by sanjeet

Have you changed the setting for your project so that it points to the Asset Catalog as the source for your Launch Image?

您是否更改了项目的设置,使其指向资产目录作为启动图像的来源?

enter image description here

在此处输入图片说明