如何以编程方式将文件夹图标放在Finder边栏上,因为您必须使用文件夹的自定义图标? [英] How do you programmatically put folder icons on the Finder sidebar, given that you have to use a custom icon for the folder?

查看:201
本文介绍了如何以编程方式将文件夹图标放在Finder边栏上,因为您必须使用文件夹的自定义图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在一个项目,虽然我可以通过添加到com.apple.sidebarlists.plist文件中添加边栏项目,然后重新启动Finder,我似乎不知道如何使文件夹图标显示使用它

Am currently working on a project, and though I can add sidebar items by adding to the com.apple.sidebarlists.plist file then restarting Finder, I can't seem to know how to make the folder icons show up using its assigned custom icon.

任何人都可以指向我的链接或解决方案,让我这样做吗?非常感谢一大堆!

Can anyone point me to a link or a solution that would make me do this? Thanks a bunch in advance!

推荐答案

没有支持的方法来使用纯Cocoa。请改用LSSharedFileList API。它是管理侧边栏列表的支持方式,您可以在插入项目时提供自定义图标(作为IconRef从Icon Services)。

There's no supported way to do this using pure Cocoa. Use the LSSharedFileList API, instead. It's the supported way to manage the sidebar lists, and you can provide a custom icon (as an IconRef from Icon Services) when you insert an item.

这篇关于如何以编程方式将文件夹图标放在Finder边栏上,因为您必须使用文件夹的自定义图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆