compose-webview-multiplatform icon indicating copy to clipboard operation
compose-webview-multiplatform copied to clipboard

Setting Background color does not work on iOS

Open Vaibhav2002 opened this issue 1 year ago • 2 comments

WebView background takes the color of system theme even after setting background color explicitly Version used - 1.9.40

state.webSettings.apply {
    isJavaScriptEnabled = true
    iOSWebSettings.apply {
        scrollEnabled = true
        backgroundColor = Color.White
    }
}

Vaibhav2002 avatar Jan 01 '25 09:01 Vaibhav2002

Any workaround for this ?

thibauddavid avatar Feb 21 '25 12:02 thibauddavid

I ended up just setting the background color when creating the WebViewState. For my use case I have to load the data anyway on background color change, so this works out

remember(backgroundColor) {
        WebViewState(WebContent.Data(
          data = ""
        )).apply {
          webSettings.apply {
            this.backgroundColor = backgroundColor
            this.supportZoom = false
          }
        }
      }

msasikanth avatar Mar 08 '25 01:03 msasikanth