Adapt icons to Dark mode in iOS Settings

I'm adapting an app to dark mode.


In the app settings (IOS settings under app name), I have a slider with icons for minimum and maximum values.

I tried to adapt those icons as follows:

- the file name in Root.plist is maxImage: unchanged

- In xcassets, I change the maxImage Image Set Apparences from Any to Any, Dark

This added placeholders for 3 more icons, as anticipated

- I dragged icons in those placeholders (names maxImageDark, maxImageDark@2X, maxImageDark@3X)

They appear correctly in root.plist


But when I open (in simulator) the apps preferences in Dark mode, I get the "any appearance" icon, not the dark appearance.


I also tried to set Appearances to Any, light, dark

- I got 6 more icon placeholders

- I moved iicons from any to light. (so, no more icon in Any part of the imageSet)

- Does not work either.


I wondered if that could be some cache side effect in the simulator.

So, I tried on another device simulator.

No change

What am I missing ?

Answered by Claude31 in 384723022

I found a way around.


I created icons with a dark border and light content. So that they appear good on a white and on a black background.

I copied those icons in the Settings Bundle.


Good enough.


I understand it is not possible to adapt to light/dark mode in those settings.

I noted (in the attributes inspector of the Image Set from Assets.xcassets) that:

- "light" icons Color Space is iMac

- "dark" icons Color Space is sRGB IEC61966-2-1


How could I change it to iMac, just for a test. ?


EDITED

Seems that icon used is the one in Settings Bundle (a .png file).

And I cannot find how to set it for multiple appearances.

Accepted Answer

I found a way around.


I created icons with a dark border and light content. So that they appear good on a white and on a black background.

I copied those icons in the Settings Bundle.


Good enough.


I understand it is not possible to adapt to light/dark mode in those settings.

Adapt icons to Dark mode in iOS Settings
 
 
Q