Status bar item icon is always black
Status bar item icon is always black
- Subject: Status bar item icon is always black
- From: Gabriel Zachmann via Cocoa-dev <email@hidden>
- Date: Wed, 17 Jun 2020 20:17:47 +0200
I am trying to define an icon for a very simple status bar menu item.
My problem is that it appears always as black, or not at all, or grey-ish,
depending on what I have tried, but not as intended.
I have populated the asset catalog with icon images of all the required sizes
that work fine in another , regular app. No luck.
I have populated the asset catalog with just one icon that I downloaded from
here
https://koenig-media.raywenderlich.com/uploads/2015/03/email@hidden
which is supposed to work.
I still just get a black rectangle in the status bar.
(The status bar app works, btw.)
Ideally, I'd like my icon for my status bar app be in color.
Here is the code:
let statusBar = NSStatusBar.system
statusBarItem_ = statusBar.statusItem( withLength:
NSStatusItem.squareLength )
// statusBarItem_.button?.title = "AAL"
let itemImage = NSImage(named: "AppIcon")
itemImage?.isTemplate = true
statusBarItem_.button?.image = itemImage
I have tried it with and without isTemplate = true.
Could anyone please give me a hint what I can try?
Thanks a lot in advance.
Best, G.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden