Skip to content

Commit

Permalink
fix(backgroundColor scrolling): ios add opaque params default true
Browse files Browse the repository at this point in the history
  • Loading branch information
riveronly committed May 25, 2024
1 parent 3767b3b commit c39b3c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,24 @@ sealed class PlatformWebSettings {
* IOS web settings
*/
data class IOSWebSettings(
/**
* The ios default opaque display
* The default value is {@code true}.
*/
var opaque: Boolean = true,
/**
* The background color of the WebView client. The default value is {@code null}.
* Will use WebSettings backgroundColor when null.
*
* @param opaque need set into false
* @param backgroundColor a color value
*/
var backgroundColor: Color? = null,
/**
* The background color shown when the WebView client scrolls past the bounds of the active page.
* The default value is {@code null}. Will use WebSettings backgroundColor when null.
*
* @param opaque need set into false
* @param underPageBackgroundColor a color value
*/
var underPageBackgroundColor: Color? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ fun IOSWebView(
)
this.navigationDelegate = navigationDelegate

setOpaque(false)
state.webSettings.let {
val backgroundColor =
(it.iOSWebSettings.backgroundColor ?: it.backgroundColor).toUIColor()
Expand All @@ -106,8 +105,11 @@ fun IOSWebView(
it.iOSWebSettings.underPageBackgroundColor
?: it.backgroundColor
).toUIColor()
setBackgroundColor(backgroundColor)
scrollView.setBackgroundColor(scrollViewColor)
setOpaque(it.iOSWebSettings.opaque)
if (!it.iOSWebSettings.opaque){
setBackgroundColor(backgroundColor)
scrollView.setBackgroundColor(scrollViewColor)
}
scrollView.pinchGestureRecognizer?.enabled = it.supportZoom
}
state.webSettings.iOSWebSettings.let {
Expand Down

0 comments on commit c39b3c4

Please sign in to comment.