V
V
Vladimir Banduristov2020-12-06 09:18:07
Apache Cordova
Vladimir Banduristov, 2020-12-06 09:18:07

How to deal with force dark mode in Cordova?

In recent Android phones, a force dark mode has appeared for WebView which itself inverts colors, and accordingly, when creating an application in conjunction with Vuejs + Cordova, it affects exactly the same as Android can be forbidden to influence WebView in this vein, no matter what it tries apply a dark theme to the application?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SharUpOff, 2021-08-06
@SharUpOff

1. Try the solution from here https://stackoverflow.com/a/66640823 2. If it doesn't help, I wrote this plugin https://www.npmjs.com/package/cordova-plugin-andro...
<meta name="color-scheme" content="light dark" />

cordova plugin add cordova-plugin-android-webview-manager

WebViewManager.setForceDarkAllowed(false)
    .then(console.info)
    .catch(console.error);

⚠️ Well, in a good way, after that you need to load your styles for correct Dark Mode support.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question