简体   繁体   English

XCode App Icon错误

[英]XCode App Icon error

I made PNG 58×58 image named myIcon@2x.png and set to app icon. 我制作了名为myIcon@2x.png PNG 58×58图像并设置为app图标。
When build by simulator, the app correctly run. 当通过模拟器构建时,应用程序正确运行。
But when real machine, the app outputs error 但是当真机时,应用输出错误
with message Failed to write PNG data for the app icon set from "AppIcon appiconse.../test.app/AppIcon29×29@2x.png with message Failed to write PNG data for the app icon set from "AppIcon appiconse.../test.app/AppIcon29×29@2x.png
Why do such error occur? 为什么会出现这种错误?

Try to find answer here - Build app with Xcode 4 - it always show some error about PNG image 尝试在这里找到答案 - 使用Xcode 4构建应用程序 - 它总是显示有关PNG图像的一些错误

There is solution: 有解决方案:

You have to save your PNG files as NOT INTERLACED. 您必须将PNG文件保存为NOT INTERLACED。 Try to open the file in photoshop (or similar), save as, and select "Not interlaced". 尝试在photoshop(或类似)中打开文件,另存为,然后选择“Not interlaced”。

I guess that you use simulator with retina display, but device with non-retina display. 我猜你使用带有视网膜显示器的模拟器,但设备带有非视网膜显示器。
Icon with size 58×58 is used for iPhone Settings/Spotlight, iPad Settings for retina display. 尺寸为58×58的图标用于iPhone设置/聚光灯,用于视网膜显示的iPad设置。
Icon with size 29×29 is used for the same aims but for non-retina display. 尺寸为29×29的图标用于相同的目的,但用于非视网膜显示。

  1. Actually you need add icon with size 29×29 . 实际上你需要添加尺寸为29×29的图标。
  2. If this icon exists in your project then check if it is really uses PNG format. 如果项目中存在此图标,请检查它是否真的使用PNG格式。

The 58 x 58 size is for the Settings icon, not the app icon. 58 x 58大小适用于“设置”图标,而不是应用程序图标。 Look at the Apple Docs for details 有关详细信息,请查看Apple Docs

App icon (required for all apps) 120 x 120, 152 x 152, 76 x 76 应用程序图标(所有应用程序都需要)120 x 120,152 x 152,76 x 76

Settings icon (recommended) 58 x 58, 29 x 29 设置图标(推荐)58 x 58,29 x 29

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

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