2014-09-13 27 views
3

我正在使用Swift中的狀態欄應用程序。我試圖通過添加Application is agent (UIElement)項目來隱藏窗口並將其設置爲YES,但它不起作用 - 它始終顯示窗口和菜單欄。「應用程序是代理」在Swift中不起作用

我的故事板:

enter image description here

的Info.plist:

enter image description here

我能做些什麼?

+0

我有同樣的問題,我無法修復。你可以以某種方式做到這一點? – Gabamnml 2015-03-17 04:10:15

+0

其實不能解決這個問題。 – 2015-03-17 06:50:21

回答

0

配置您的NSStatusBar與標題,圖像,替代圖像等,你會看到它在系統的狀態欄。

let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(NSVariableStatusItemLength) 

    statusItem.button?.title = "LG" 
    statusItem.button?.image = NSImage(named: "LGIcon") 
    statusItem.button?.alternateImage = NSImage(named: "LGIcon") 
相關問題