Closed ruirui1128 closed 1 year ago
1 Use "https:google.com" to display 2 Use your own URL but it doesn't display
setContent { val systemController = rememberSystemUiController() LaunchedEffect(key1 = Unit) { systemController.setStatusBarColor(Color.Transparent, true) } M3Theme { Surface( modifier = Modifier.fillMaxSize(), color = MaterialTheme.colors.background ) { Box(modifier = Modifier .fillMaxSize() .background(Color.Black)) { val state = rememberWebViewState(viewModel.url.value ?: "") WebView( state, modifier = Modifier .fillMaxSize() .absolutePadding(top = 25.dp), onCreated = { it.settings.javaScriptEnabled = true }, ) } } } }
viewBinding.webView.also { it.settings.javaScriptEnabled = true it.loadUrl("${url}") }
Describe the bug
1 Use "https:google.com" to display 2 Use your own URL but it doesn't display
3 But I use XML the traditional way, it's all fine
Screenshots
code
xml its all ok
Environment: