Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Change statusbar color and splash screen color based on dark theme

ganesh96ganesh96 Member ✭✭✭

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).

Best Answer

Answers

  • jezhjezh Member, Xamarin Team Xamurai
    edited October 16

    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.

  • ganesh96ganesh96 Member ✭✭✭

    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?

  • ganesh96ganesh96 Member ✭✭✭

    EDIT

    Statusbar color will now change when the device is set to dark mode.

  • jezhjezh Member, Xamarin Team Xamurai
    edited October 22

    Statusbar color will now change when the device is set to dark mode.

    Do you mean your question has been resolved,right? Congrats.

  • ganesh96ganesh96 Member ✭✭✭

    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.

  • Tracy320Tracy320 Member ✭✭✭

    Can you upload your code? So we can help you better.

  • ganesh96ganesh96 Member ✭✭✭

    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.

Sign In or Register to comment.