Re: Status bar item icon is always black
Re: Status bar item icon is always black
- Subject: Re: Status bar item icon is always black
- From: Gabriel Zachmann via Cocoa-dev <email@hidden>
- Date: Fri, 19 Jun 2020 21:54:24 +0200
I think, I solved the mystery.
Just for the record, in case someone else stumbles across this
(it's probably old news for you guys on this list):
You can use a vector drawing in a PDF , drag it into the asset catalog (not
into the default AppIcon!),
and load it as if it were a regular image , and it works, even with
itemImage?.isTemplate = false
(in that case, colors in the icon will be nicely preserved).
I believe, NSImage() converts it into a bitmap during loading. Maybe, Xcode
does it already.
If you want to load a bitmap image, then do NOT try to populate the default
AppIcon with all the resolutions , from 16x16 pixels through 512x512@2x !
You will get a mostly black-ish status bar icon.
You would do that for a regular app, but it does NOT work for status bar items.
You must use a 32x32 image, and this shows fine in color in the status bar.
If you drag that into the asset catalog, you will get a regular image set in
Xcode;
then you can also populate the 2x and the 3x versions with resolutions of 64x64
and 96x96 bitmaps.
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