Dark mode does not switch to a Dark mode background in Xcode

Viewed 6554

I have set up different backgrounds for 'Light/Dark Appearance'

enter image description here

But when switching between Light/Dark mode within Xcode, my background always uses image from 'Any/Light Appearance'. Only colours set for icons changes accordingly.

enter image description here

FYI: I'm switching between Light/Dark mode using Interface Style option.

enter image description here

Can someone please advice what I'm missing on? It's all new to me.

9 Answers

I think it is an Xcode bug. You can confirm it by changing your setting in the iOS Simulator.

Go to Settings -> Developer -> Dark Appearance

I think you might need to uncheck the Resizing checkbox and set the Scales property to Single Scale. It worked for me.

enter image description here

Set your image to Render As Original Image

I think it's an Xcode (latest version) bug.

If you run it on your phone, you won't have this problem. Meaning settings are correct.

In Simulator it's working fine. One can confirm by toggling the Appearance from feature menu of the simulator.

This seems like an Xcode bug, but when you try to run it on your simulator or physical device, it should work perfectly assuming you are in Dark Mode.

By unchecking the Preserve Vector Data option 1, one can see the change in the background when switching between the modes from interface styles 2.

But I noticed that if you leave the option selected and test it on the simulator, it works perfectly fine there. Hence I feel it's an Xcode bug too.

enter image description here

enter image description here

The Xcode Bug is still here, Xcode storyboard appearance switcher does not work, it only works in the simulator.
You can change the simulator device appearance: Settings> Developer> Dark Appearance.


Happy coding.

On my physical device iPhone 8 iOS 14.6 dark Mode doesn't work. traitCollectionDidChange not get called after switching to dark mode. On my iPhone 12 iOS 15.x, and some testers it works. No Solution i tried worked. Also i got some other weird UI bugs aswell on my iPhone 8.

Hope its just an Xcode Bug.

Related