OSX 自定义扩展图标关联
我试图让我的应用程序使用以下代码显示自定义文件扩展名的图标:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>My Custom Extension</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.myapp.myext</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>NSExportableTypes</key>
<array>
<string>com.myapp.myext</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIconFile</key>
<string>Myicon.icns</string>
<key>UTTypeDescription</key>
<string>My Custom Extension</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeIdentifier</key>
<string>com.myapp.myext</string>
<key>UTTypeReferenceURL</key>
<string>http://www.myapp.com</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>myext</string>
</array>
</dict>
</dict>
</array>
我尝试使用 UTTypeIconFile 和 CFBundleTypeIconFile,并且图标是存在于应用程序包内的 Content/Resources 文件夹下,但在查看具有我的文件扩展名的文件时,我仍然看到一个空白图标,
我不确定这是否重要,但此应用程序是使用 JavaApplicationStub 启动的强>(这是一个java应用程序)
任何帮助将不胜感激:)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我仅通过使用JavaApplicationStub了解了一些问题。您是否尝试使用 Apple 的 Jar 捆绑程序?您应该能够注册您的文件类型应用程序支持。
I read about some problems by using just the JavaApplicationStub. Did you try to build an
.app
with Apple's Jar Bundler? You should be able to Registering the File Types Your App Supports.