Skip to content

WebView always rendering in dark mode on Android even when system is in light mode #350

@bvic-dev

Description

@bvic-dev

On Android, the WebView consistently renders pages in dark mode, even if the phone is set to light mode. On iOS, it correctly respects the system theme (light/dark).


Steps to reproduce

  1. Create a Compose Multiplatform project using the Wizard:
    https://terrakok.github.io/Compose-Multiplatform-Wizard/

  2. Add the compose-webview-multiplatform dependency.

  3. On Android, ensure you have the Internet permission declared in AndroidManifest.xml:

    <uses-permission android:name="android.permission.INTERNET" />
  4. In shared code (common module), use the following:

    val state = rememberWebViewState("https://github.com/KevinnZou/compose-webview-multiplatform")
    WebView(state, modifier = Modifier.fillMaxSize())
  5. Run the app on an Android device/emulator configured for light mode.


Observed Behavior (Android)

  • The webpage is rendered in dark mode, despite the system being in light mode.

Expected Behavior

  • The WebView should either:

    • Respect the system theme (light/dark), or at least
    • Not force dark mode when the system is set to light.

Platforms

  • Android: issue reproducible
  • iOS: behaves correctly (follows system theme)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions