Cordova-plugin-ionic-webview: How to set background color

Created on 13 Nov 2018  路  3Comments  路  Source: ionic-team/cordova-plugin-ionic-webview

I have a black theme app and sometimes when the app starts, or even when i call a native plugin the background appears white. I want to change this to back if it is possible. Thanks

Most helpful comment

Just solve it with this line of code in the CDWKWebViewEngine.m just after the WebViewEngine is created.
webView.opaque = false

All 3 comments

I think you will have to set the background colour (on iOS the wkwebview background and the background of the scrollview) within the native code. For iOS that would be somewhere after the webview declaration within the method pluginInitialize in CDVWKWebViewEngine.m

@wilk-polarny thanks I will definitely try it and let you know.

Just solve it with this line of code in the CDWKWebViewEngine.m just after the WebViewEngine is created.
webView.opaque = false

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yuripetusko picture Yuripetusko  路  3Comments

mowaiskalam picture mowaiskalam  路  6Comments

jamesdixon picture jamesdixon  路  4Comments

lincolnthree picture lincolnthree  路  7Comments

peterpeterparker picture peterpeterparker  路  6Comments