Images in UI in dark mode
Images in UI in dark mode
- Subject: Images in UI in dark mode
- From: David Durkee via Cocoa-dev <email@hidden>
- Date: Fri, 24 Jul 2020 11:22:25 -0500
- Resent-date: Fri, 24 Jul 2020 15:54:31 -0500
- Resent-from: David Durkee <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: email@hidden
I am finally updating my application to support dark mode. I’ve run into a
hitch in a place where I use images in buttons or other controls. I formerly
put the name of the png image in the image field of the control or segment in
question. I updated for dark mode by creating new images for dark mode,
creating image sets in an asset catalog, including both light and dark mode
versions of the images in the image set, and repointing the controls or
segments to the new image sets (which uses different names from the original
images).
This looks right in the xib window in Xcode when I switch between light mode
and dark mode display. But when I build and run the program, I am only seeing
the light mode versions of the images used even when I am in dark mode. I have
verified that it is using the image sets by changing the images in the light
mode slots, but it is never using the dark mode versions from those sets.
All other controls in the view are respecting light mode and dark mode changes.
The chrome of the control that contains the image is also changing correctly.
I have also created new controls in the xib or different types and they behave
the same way.
Any idea what I'm doing wrong?
David
_______________________________________________
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