xcode 为什么要在 info.plist 文件中添加图标?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38068229/
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
Why to add icons in info.plist file?
提问by TechChain
I have added required icons files in my app. But when I upload app to app store then it shows me an error saying Bundle does not contain icon file 57*57but in my app I already have it.
我在我的应用程序中添加了所需的图标文件。但是当我将应用程序上传到应用程序商店时,它会显示一条错误消息,说捆绑包不包含图标文件 57*57,但在我的应用程序中我已经有了它。
I developed this app in Xcode 5 then that time I added icons in info.plist because on some of devices icons were not visible.
我在 Xcode 5 中开发了这个应用程序,然后我在 info.plist 中添加了图标,因为在某些设备上图标不可见。
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon76</string>
<string>icon40</string>
<string>icon40@2x</string>
<string>icon60@2x</string>
<string>icon40@3x</string>
<string>icon50@2x</string>
<string>icon50</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>
So why do we add icons in plist because in my latest project in xcode 7 I did not add icon name in plist still it was uploaded on app store.
那么为什么我们要在 plist 中添加图标,因为在我最新的 xcode 7 项目中,我没有在 plist 中添加图标名称,但它仍然上传到了应用商店。
UPDATE
更新
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
used above code in plist & tried to run it does not show any icon
在 plist 中使用上面的代码并尝试运行它不显示任何图标
回答by Saheb Roy
Use Image Assets and fill up all icons with respective size and resolutions. In turn it automatically gets added to the pList, as Xcode does this part itself, just like when you add URL schemes in project settings, all those URL gets added in plist by XCode itself. While uploading to Appstore, they check the plist info.
使用图像资产并用各自的大小和分辨率填充所有图标。反过来它会自动添加到 pList 中,因为 Xcode 自己做这部分,就像在项目设置中添加 URL 方案一样,所有这些 URL 都会由 XCode 本身添加到 plist 中。在上传到 Appstore 时,他们会检查 plist 信息。
回答by Abhi
follow these steps it helps you
遵循这些步骤它可以帮助你
- Select Project target.
- Choose app icons and source image > select AppIcon > then click on arrow button
- 选择项目目标。
- 选择应用程序图标和源图像 > 选择 AppIcon > 然后单击箭头按钮
- An empty app icon set is created, with an image well for each image representation in the set.
- 创建了一个空的应用程序图标集,集合中的每个图像表示都有一个图像井。
Drag an app icon from the Finder to the appropriate image well in the set viewer.
将应用程序图标从 Finder 拖到集合查看器中的相应图像。