Why is app icon white?

▼魔方 西西 提交于 2019-12-13 12:40:24

问题


Some recent version of iOS caused my app icon to turn white. I've gone through everything in regards to images and can't find the issue. I'm running Xcode 3.2.5 with sdk 4.2. I do have an entry for "Icon files" in Info.plist with 5 keys: Item 0 myapp.png Item 1 myapp@2x.png Item 2 myapp-72.png Item 3 myapp-Small-50.png Item 4 myapp-Small.png Item 5 myapp-Small@2x.png

All the above have proper dimensions.

I see the image in 'Copy Bundle Resources' and also in the .app file for the simulator version. It is properly reference by name in 'Icon files', Item 0. It is not named Default.png since it is referenced by name in Item 0.

Any suggestions?


回答1:


You just need those 3 Files:

Icon.png Icon@2x.png Icon-iPad.png

Put the names into the Info.plist under Icon Files.

EDIT: Clean your target if it still won't work!




回答2:


That is what helped me (project summary - app icons are ok, iOS simulator - app icons are ok, iPhone device - blank icon). Just reconnect your icons to project by dragging them from project navigator to App icon section in project summary.




回答3:


When does it turn white? If you upgrade an app when it's running, sometimes it appears with a white icon in the "task" bar. This applies to apps you're developing and those download from iTunes. The fix is usually just to kill the app and restart.

That's the simplest answer, but I suspect might not be the solution.

Does the case of the file names in your Info.plist match the actual file names? The Simulator is not case sensitive but the iOS is.

You might also like to make a completely clean build. Don't just do a "Clean" in Xcode, instead manually clear out your build folder.

Finally, when the iPhone 4 first came out I had some issues with the order of the icons referenced in the Info.plist. I never saw white icons (usually just the non-Retina version) but this may be something worth playing with if nothing else works.




回答4:


The icon file name may be too long if it is a custom file name. This is just a guess, and I hate guessing, but this appears to have been the problem I just had.

I have four targets using the same code but with different icons. I named the icons differently based on the app name, so I could store them in the same directory.

For example:

Icon.png
Icon_second.png
Icon_alternate.png
Icon_second_alternate.png (or Icon_secondalternate.png in case underscores were an issue)

This nomenclature was used for all of the icon names (there's 8 icon files to support iPhone, iPad, retina, etc).

The last one was giving me a problem. Despite a hundred clean/rebuilds, deleting the schema entirely and creating a new one, fruitless efforts, it suddenly occurred to me to try renaming it.

You should be able to name the icons differently, as I still use the first three versions. They are listed in the plist file and render in the project summary, and on the simulator, just fine. The last one rendered in the summary as well. However, I think the length of the file name was too long for the simulator. There must be a length limit. I renamed the fourth one to use the standard Icon.png naming but added it to the fourth target only (images are stored in a separate folder).

CONCLUSION: If you have more than one target for your app, use the standard naming system for all of your icons but add them to separate folders, and then when adding to Xcode just set the build target appropriately.




回答5:


If you still have the default icon entry (even blank), this can happen, remove that entry in info.plist.

Also, Default.png would be your splash screen.




回答6:


Load the icons into the Preview application, and make sure they are really png format (and not just named such) by doing a "Save As..." specifying PNG format in the save dialog. Do a Get Info to check the sizes. Make sure the case of all letters in the name match your plist entries.




回答7:


I had the same problem recently - the Icons I was using were created in GIMP. When I opened them in Photoshop on the development Mac it complained about an ICC color profile. After re-saving the PNGs in Photoshop the Icons worked like a treat.

P.s. I just repeated my steps in creating the images in GIMP, but when saving unticked every extra option that GIMP - by default - was trying to add into the image when saving it. The icons worked perfectly this time around.




回答8:


If you believe your icon configuration is correct, then you may simply be seeing a bug in Xcode.

As a workaround…

  • "Clean" your project. Choose Xcode > Product > Clean.
  • Delete the app from your simulator, or even reset the Simulator by choosing iOS Simulator > Reset Content and Settings.
  • Quit both the iOS Simulator and XCode apps, then restart them.


来源:https://stackoverflow.com/questions/5068296/why-is-app-icon-white

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!