iPhone Simulator Icon Black

允我心安 提交于 2020-02-05 08:19:41

问题


I have two Icon files in my plist: icon.png icon@2x.png

Both are added to my project, added to the target and are 57x57 and 114x114 pixels respectively, both 72 dpi.

They are both pngs generated from a .svg.

I filled out the transparency with white. The rest of the coloring is black.

I have tried deleting the app, clearing derived data and re-running.

Why is this icon showing a black square in the iPhone 6 simulator?

EDIT: Tried renaming to capital I in Icon.png and Icon@2x.png. Wiped app, wiped derived data, clean, still no dice.


回答1:


Try the following:

1 - On the simulator remove your app just like you delete an app on an iPhone.

2 - On xcode go to the menu Product and click Clean. (Or the shortcut Shift+Command+K)

3 - Try to run again.

edit: When you open the png's on your computer do they actually show the white?




回答2:


So I was having the same problem and found this old thread. In my case the issue turned out to be the alpha channel in the PNG icon. Specifically: my icon was black-on-transparent, so on the simulator with a black background it showed as black-on-black. I solved by opening in Preview and exporting with the "alpha" button turned off.



来源:https://stackoverflow.com/questions/13242759/iphone-simulator-icon-black

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