Hi,
I have enabled dark theme in my Xamarin.Forms app. Almost everything could be done cross-platform, except two things: splash background color and statusbar color.
Now I managed to do this for Android (by setting a folder called 'values-night'), but I cannot figure out how to do this for iOS.
Does someone know how to change the color of the splashscreen background and statusbar when the phone itself is set to dark theme?
(I'm using Visual Studio Community on Windows. A connection to a remote desktop (Apple Mac) can be made).
Sorry, launch storyboard can not do something according to different screen. because it not contains the property with screen size for us to call, and we also can not use code for launch stroryboard.
Answers
For this, you can check Xamarin: Creating a Dark Mode Splash Screen
We can create our iOS Splash Screen using
Storyboards
that displays an image on a blank background. To support Dark Mode, we can add 2 versions of our image into our Asset Catalog, one for dark mode and one for light mode.For ios, please check the
iOS Splash Screen
part of this article.And you can find the completed solution here: https://github.com/brminnick/DarkModeSplashScreen
Hope it can help you.
Hi @jezh
I saw this tutorial as well. Luckily, my image will be the exact same for light and dark theme, only the background color changes.
However, the background for my light theme should be blue, while the background for my dark theme should be grey. Do you know how to do this?
EDIT
Statusbar color will now change when the device is set to dark mode.
Do you mean your question has been resolved,right? Congrats.
Hi @jezh
My question is partially solved: I still don't know how to let the splashscreen be blue with the light theme and gray with the dark theme.
Can you upload your code? So we can help you better.
Hi @Tracy320
I cannot upload my code since there is no code. Visual Studio has a designer for the splash screen for iOS when connected a Mac. So there is simply no code that I can show you.
Sorry, launch storyboard can not do something according to different screen. because it not contains the property with screen size for us to call, and we also can not use code for launch stroryboard.