iphone sdk:应用程序图标未在模拟器中显示

发布于 2024-08-23 05:38:02 字数 404 浏览 10 评论 0原文

我在 Xcode 中为我的项目添加了一个 Icon.png 到我的组和文件中。我在 .plist 文件中指定使用 Icon.png。我检查了根文件夹,它成功复制了 Icon.png。但是当我运行模拟器时,主屏幕上的图标仍然是灰色的?

另请注意,当我第一次添加图标时它起作用了!然后我更改了捆绑包名称、捆绑包标识符和捆绑包显示名称。模拟器在主屏幕上创建了第二个图标,这两个图标都打开了同一个应用程序。

我从主屏幕上删除了这两个图标,现在构建后它总是会创建一个灰色按钮。

我尝试将 plist 恢复到前一天的备份,只是更改图标,但没有成功!我还尝试创建一个新的空白项目并添加图标,但仍然没有成功。

这让我抓狂,它在项目中以 Icon.png 的形式存在,而且我以前见过它出现过!我知道这听起来很疯狂,但是更改捆绑信息怎么会影响图标呢?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

偏闹i 2024-08-30 05:38:02

我无法让 Icon.png 显示在 Xcode 的资源列表中,直到我实际将图标从 Finder 拖放到 Xcode 资源文件夹中。

仅将文件物理放置在那里并在 info-plist 文件中设置其名称并不能完成这项工作。

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.

怪我入戏太深 2024-08-30 05:38:02

Xcode 并不总是检测到 plist 文件中的更改。清理你的目标并重建它会改变什么吗?

编辑
在黑暗中拍摄,但检查图标的权限(一旦进入构建的应用程序)。如果它不可读,则可能是导致您出现问题的原因。

另外,如果您最近安装了 sdk,那么您是否重新启动过?

编辑2
检查你的图标文件的名称和 plist 文件中 CFBundleIconFile 键的值,注意大小写 (icon != Icon)

你能发布你的 plist 文件吗?

通过测试项目,我发现即使 CFBundleIconFile 键的值为空,也会自动选取名为 Icon.png 的图标文件。

请记住,此 SKD 是:

  • 仍处于
  • NDA测试阶段

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
浅暮の光 2024-08-30 05:38:02

我刚才遇到了这个问题。我已经将其拖入 Xcode 并更新了 plist 文件,但无济于事。清理所有目标并重建对我来说很有效。也许你只需要清洁一个目标,但我决定清洁所有目标以达到良好的效果。

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.

暖心男生 2024-08-30 05:38:02

如果添加图标时看不到所做的更改,请尝试重命名捆绑包显示名称或其他一些属性。看起来当你对 info plist 文件进行一些更改时,Xcode 会拾取它们。更改捆绑包名称对我有用。

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.

横笛休吹塞上声 2024-08-30 05:38:02

我通过删除并重新导入图标 png 解决了这个问题。当我的目标是 4.0 时,我的症状是灰色图标;当目标是 3.2 时,我的症状是正确的图标,来自相同的代码库和 info.plist。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文