Capacitor.config.json backgroundColor has no effect?

Hello!

Using Capacitor v6.

We’re transitioning from Cordova to Capacitor and frankly loving it, everything is going great, just ran into this little issue that we can’t figure out.

In our capacitor.config.json we have the following, but when the app launches there is a white background on launch until our css sets the desired colors.

How do we make the default background color for the webview black as to not see this white flicker on launch?

Note we’re not using the splash screen plugin.

Thanks for any advice!

Bill K

{
  "appId": "xxx",
  "appName": "xxx",
  "webDir": "www",
  "backgroundColor": "#000000",
  "cordova": {
    "preferences": {
      "SuppressesLongPressGesture": "true",
      "DisallowOverscroll": "true",
      "AllowInlineMediaPlayback": "true",
      "FadeSplashScreen": "false",
      "scheme": "app",
      "hostname": "localhost",
	  "backgroundColor": "#000000"
    }
  }
}

Update with more information …

It’s not the body/html css colors. The capacitor.config.json webview colors are definitely honored, tested that.

However, when launching on ios it’s white until it comes up and then the webivew background color is set.

Any way to get rid of the initial flash of white? Spash didn’t help.

Thanks :smiley:

Got it … changed the splash screen’s image view’s background color to black in XCode. Done. :smiley:

1 Like