Closed TerryGlen closed 3 months ago
@TerryGlen Thank you for your contribution! You did an excellent job. Just to confirm, have all the newly added iOS settings been tested?
Glad to help! I have made a minor update to make underPageBackgroundColor nullable.
I've tested each setting on my local device (iPhone 7 Plus: iOS 15.8) and simulator (iPhone 15: iOS 17.2).
Below are comparisons for each added setting. The source code for each being a variation of the one in my previous comment.
@TerryGlen Great job! Your work is amazing. I will merge it and release the new version next week. Thank you for your contribution once again!
I came across this PR from https://github.com/JetBrains/compose-multiplatform/issues/3154
i'm struggling to make the UIKitView transparent but it keeps on showing a white background, did you manage to solve this issue?
Hello @ismai117 , According to the kotlin multiplatform slack thread linked above it looks like a new configuration option was added to ComposeUIViewController with 1.6.0-beta02 and later.
I haven't had a chance to test this myself, but this should point you in the right direction.
In this PR I have updated the IOSWebSettings object with common WKWebView settings. This allows for more customization of the client on the IOS platform.
While the Android WebView client is capable of having a transparent background due to the limitations of UIKitView IOS is not. As shown below.
In short, the UIKitView itself is drawn on top of a white background and this functionality is not able to be overridden*. This means when WebSettings backgroundColor is set to transparent the IOS Webview will instead show the UIKitView’s white background. To mitigate this, I have added an IOSWebSettings specific nullable backgroundColor. This is helpful in the use case where the user would like Android and Desktop client to be transparent but would prefer to set IOS webview background color to the next best option. If this value is null it will instead use the WebSettings background color.
*An alternative method is discussed in this kotlin compose-ios thread. If the user implements a custom ComposeUIViewController it is possible to have a transparent UIKitView but it requires overriding internal compose multiplatform classes.