启动图像未在 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
Launch images not showing with Xcode 7
提问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 LaunchScreen
file 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 File
parameter 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]
吗?
回答by Dhaivat Vyas
Well what I've noticed that when you create a new project by default you will get LaunchScreen.storyboard
as you Launch Screen Image.
好吧,我注意到,当您默认创建一个新项目时,您将LaunchScreen.storyboard
在Launch Screen Image 时获得。
But if you don't want to use LaunchScreen.storyboard
then what you do is remove LaunchScreen.storyboard
and 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.xcasets
folder.
现在单击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.
This is how your LaunchImageshould be visible.
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.
现在转到application>Targets>General并在Launch Images Source 中选择LaunchImage。
Here is the image with LaunchImageadded in Assets.xcassets
.
这是添加了LaunchImage的图像Assets.xcassets
。
Simulator Image on launching App.
Hope it helps in solving your problem.
希望它有助于解决您的问题。