compose-webview-multiplatform
compose-webview-multiplatform copied to clipboard
Setting Background color does not work on iOS
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
}
}
Any workaround for this ?
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
}
}
}