开发者

iphone sdk: application icon not displaying in simulator

开发者 https://www.devze.com 2022-12-21 00:13 出处:网络
I added an Icon.png to my Groups and Files in Xcode for my project. I specified in the .plist file to use开发者_开发知识库 Icon.png. I checked the root folder and it successfully copied Icon.png. But

I added an Icon.png to my Groups and Files in Xcode for my project. I specified in the .plist file to use开发者_开发知识库 Icon.png. I checked the root folder and it successfully copied Icon.png. But when I run the simulator the icon on the home screen is still gray?

Also note, when I first added the icon it worked! Then I changed the Bundle Name, Bundle identifier and Bundle display name. The simulator created a second icon on the home screen, both of which opened the same app.

I deleted both icons from my home screen and now after a build it always creates a gray button.

I tried reverting the plist to a day priors backup, just changing the icon, no luck! I also tried creating a new blank project and adding the icon, still no luck.

It's driving me nuts, it's in the project as Icon.png and I've seen it show up before! I know this sounds crazy, but how could changing Bundle info effect the icon at all?


I was unable to get the Icon.png to show up in my Resource list in Xcode until I actually dragged and dropped the icon from Finder into the Xcode Resources folder.

Just physically placing the file out there and setting its name in the info-plist file didn't do the job.


A change in the plist file is not always picked up by Xcode. Does cleaning your target and rebuilding it change something?

Edit Shooting in the dark, but check the permission of the icon (once inside the builded application). If it's unreadable, it might be the cause of your problem.

Also, if you have recently installed the sdk, did you reboot since?

Edit 2 Check the name of your icon file and the value for the key CFBundleIconFile in the plist file by paying attention to the case (icon != Icon)

Can you post your plist file?

With a test project, I have seen that the icon file, named Icon.png is picked up automatically, even if the value for the key CFBundleIconFile is empty.

Keep in mind this SKD is:

  • Still in beta
  • Under NDA


I had this problem just now. I already had dragged it into Xcode and updated the plist file to no avail. Cleaning all targets and rebuilding worked for me. Maybe you just have to clean one target but I decided to clean all for good measure.


if you can't see your changes when you add the icon, Try renaming the Bundle Display Name or some other property. It seems like when you make some changes to the info plist file Xcode will pick them up. Changing the Bundle name worked for me.


I fixed this by deleting and reimporting the icon png. My symptoms were a grey icon when targeting 4.0 and the correct icon when targeting 3.2, from the same codebase and info.plist.

0

精彩评论

暂无评论...
验证码 换一张
取 消