File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
commonMain/kotlin/com/multiplatform/webview/setting
iosMain/kotlin/com/multiplatform/webview/web Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,13 @@ sealed class PlatformWebSettings {
188188 * IOS web settings
189189 */
190190 data class IOSWebSettings (
191+ /* *
192+ * The ios default opaque display
193+ * The default value is {@code false}.
194+ * When Value is true will turn off these two properties:
195+ * @param backgroundColor,@param underPageBackgroundColor
196+ */
197+ var opaque : Boolean = false ,
191198 /* *
192199 * The background color of the WebView client. The default value is {@code null}.
193200 * Will use WebSettings backgroundColor when null.
Original file line number Diff line number Diff line change @@ -97,7 +97,6 @@ fun IOSWebView(
9797 )
9898 this .navigationDelegate = navigationDelegate
9999
100- setOpaque(false )
101100 state.webSettings.let {
102101 val backgroundColor =
103102 (it.iOSWebSettings.backgroundColor ? : it.backgroundColor).toUIColor()
@@ -106,8 +105,11 @@ fun IOSWebView(
106105 it.iOSWebSettings.underPageBackgroundColor
107106 ? : it.backgroundColor
108107 ).toUIColor()
109- setBackgroundColor(backgroundColor)
110- scrollView.setBackgroundColor(scrollViewColor)
108+ setOpaque(it.iOSWebSettings.opaque)
109+ if (! it.iOSWebSettings.opaque) {
110+ setBackgroundColor(backgroundColor)
111+ scrollView.setBackgroundColor(scrollViewColor)
112+ }
111113 scrollView.pinchGestureRecognizer?.enabled = it.supportZoom
112114 }
113115 state.webSettings.iOSWebSettings.let {
You can’t perform that action at this time.
0 commit comments