SwiftUI_visionOS_Note

Adapting Dark Mode in visionOS??

Mar 7, 2024

VisionOS’s default colour scheme is “Default”

We can change how it seems under preview by adding

.preferredColorScheme(.light)

 
 

or we can use the adaptive colour in assets

 

or we can create an enviroment variable to make it locally adaptive

@Environment(\.colorScheme) var colorScheme

 

when it’s light mode. change the colour to green, or yellow.

 

You might also like

BlogPro logo
Made with BlogPro