如何隐藏dock图标 [英] How to hide the Dock icon

查看:315
本文介绍了如何隐藏dock图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要隐藏Dock图标并显示 NSStatusItem 的偏好。
我可以创建StatusItem,但我不知道如何从Dock中删除图标。 : - /

I want to make a preference for hiding the Dock icon and showing an NSStatusItem. I can create the StatusItem but I don't know how to remove the icon from Dock. :-/

任何想法?

推荐答案

在Info.plist中查找 LSUIElement

I think you are looking for the LSUIElement in the Info.plist


LSUIElement(String)。如果此键设置为1,启动服务将应用程序作为代理应用程序运行。代理应用程序不会显示在Dock或强制退出窗口中。虽然他们通常作为后台应用程序运行,但如果需要,他们可以来到前台呈现用户界面。

LSUIElement (String). If this key is set to "1", Launch Services runs the application as an agent application. Agent applications do not appear in the Dock or in the Force Quit window. Although they typically run as background applications, they can come to the foreground to present a user interface if desired.

a href =http://www.cocoabuilder.com/archive/message/cocoa/2009/2/3/229461 =nofollow noreferrer>此处关于开启/关闭

See a short discussion here about turning it on/off

这篇关于如何隐藏dock图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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