简体   繁体   English

iOS Xcode:我是否需要在xcode捆绑包中保留所有初始屏幕和应用程序图标图像的两个副本?

[英]iOS Xcode: Do I need to keep two copies of all the splash screen and app icon images inside xcode bundle?

I am little bit confused about whether I have to keep the splash screen and app icon images both in the root folder of xcode and inside resources folder or I need to put those in one place only. 对于我是否必须将启动屏幕和应用程序图标图像都保留在xcode的根文件夹和内部资源文件夹中,或者将它们仅放在一个地方,我有些困惑。 Currently I am storing the images at both the places as shown below. 目前,我将图像存储在两个位置,如下所示。

Xcode捆绑截图

As you can see here in the screenshot, there are two copies of all the splash screen and app icon images inside xcode bundle. 正如您在屏幕快照中看到的那样,xcode捆绑包中有所有初始屏幕和应用程序图标图像的两个副本。 Because of this I am getting copyPNGFileLib error while building the app. 因此,在构建应用程序时出现了copyPNGFileLib错误。

Please advise me which is the correct approach to store splash screen and app icon related images inside xcode bundle.. THANKS in advance... :-) 请告诉我哪种方法是将启动屏幕和与应用程序图标相关的图像存储在xcode捆绑包中的正确方法。提前感谢... :-)

Since Xcode 5 you should use the Asset Catalog feature, which removes the need for references to images, including App icons/launch images, in the project. 从Xcode 5开始,您应该使用“资产目录”功能,从而无需在项目中引用图像,包括应用程序图标/启动图像。 This makes managing images much simpler and makes things more organized in the filesystem too. 这使映像的管理变得更加简单,并且文件系统中的一切也变得更加井井有条。

The only limitation is images in the catalog are not localizable, AFAIK. 唯一的限制是目录中的图像不可本地化,即AFAIK。 So if you actually need diferent images for different locales, you have to keep these outside of the xcassets file. 因此,如果您实际上需要针对不同语言环境的不同图像,则必须将这些图像保留在xcassets文件之外。

You can convert your targets to using Asset Catalog by selecting your Project, then for each target in the Info tab you have options to migrate the Launch Images / App Icons to xcassets. 您可以通过选择项目将目标转换为使用资产目录,然后对于“信息”选项卡中的每个目标,您可以选择将启动图像/应用程序图标迁移到xcassets。 I had issues with the automatic conversion though, so I just added an Asset Catalog to the project via New File and then added my images to it. 我在自动转换方面遇到了问题,因此我只是通过“新文件”将资产目录添加到项目中,然后将图像添加到其中。

I actually don't have an answer for Xcode 4.x, but I strongly suggest you to move to Xcode 5 if possible. 我实际上没有Xcode 4.x的答案,但我强烈建议您尽可能迁移到Xcode 5。 The reason is that it comes with a new feature, Asset catalogs which organizes all your start images and app icons easily. 原因是它具有一项新功能,即资产目录,可轻松组织所有起始图像和应用程序图标。 It's a bit confusing in the very beginning but when you are used to it, all your assets will be more organized. 刚开始时这有点让人困惑,但是当您习惯了它之后,您的所有资产都将变得更有条理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM