简体   繁体   English

如何为Mac OS X Bundle设置图标?

[英]How can I set icon for Mac OS X Bundle?

I have try to set icon for my App in the xCode. 我尝试在xCode中为我的应用程序设置图标。 In the info.plist I wrote: 在info.plist中我写道:

<key>CFBundleIconFile</key>
<string>icon</string>

icon is icon.icns file 57X57 in the resources. 图标是资源中的icon.icns文件57X57。

But finally bundle does not contain an icon. 但最后bundle不包含图标。 When I press about my app Item in the menu bar an about window appears with my icon. 当我在菜单栏中按下我的应用程序项目时,会出现一个带有我的图标的about窗口。

What's wrong? 怎么了?

Please help. 请帮忙。

Thanx 感谢名单

Try <string>icon.icns</string> 尝试<string>icon.icns</string>

EDIT: An icns file is not a simple png file; 编辑:icns文件不是一个简单的png文件; see here . 看到这里 You can use Icon Composer.app included in Apple's Xcode Developer Tools ( /Developer/Utilities ). 您可以使用Apple的Xcode Developer Tools( /Developer/Utilities )中包含的Icon Composer.app to convert your icon file to icns format; 把你的图标文件转换为icns格式; just drag the file into the window area. 只需将文件拖到窗口区域即可。

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

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