Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to change the Splash Screen background color in Expo according to dark/light themes?

I'm trying to change my Splash Screen's background color on my expo app in accordance with the system's dark/light theme configuration, however since I can't reach out for the Appearance module I couldn't find a way to do so.

Is this possible at all to do within an expo app?

Thanks!

like image 666
Dor Ben Baruch Avatar asked Dec 05 '25 01:12

Dor Ben Baruch


1 Answers

Yes, I'm using Expo SDK 48.0.0 & works on Expo Go

Everything explained here is available on Expo Documentation.

First you'll need to make changes in your 'app.json' file.

If you've configured your app with a Splash Screen

{

     "expo": {

          "splash": {
               "image": "...",
               "resizeMode": "cover",
               "backgroundColor": "#ffffff"
          }

     }

}

Change it to this

{

     "expo": {

          "android": {

               "splash": {
                    "image": "...",
                    "resizeMode": "cover",
                    "backgroundColor": "#ffffff",
                    "dark": {
                         "image": "...",
                         "resizeMode": "cover",
                         "backgroundColor": "#000000"
                    }
               }

          },

          "ios": {

               "splash": {
                    "image": "...",
                    "resizeMode": "cover",
                    "backgroundColor": "#ffffff",
                    "dark": {
                         "image": "...",
                         "resizeMode": "cover",
                         "backgroundColor": "#000000"
                    }
               }

          }

     }

}

like image 167
Anda Hanise Avatar answered Dec 06 '25 17:12

Anda Hanise



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!