Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: Config param for the backgroundColor of wkWebView #1003

Closed
moberwasserlechner opened this issue Nov 26, 2018 · 3 comments · Fixed by #1696
Closed

iOS: Config param for the backgroundColor of wkWebView #1003

moberwasserlechner opened this issue Nov 26, 2018 · 3 comments · Fixed by #1696

Comments

@moberwasserlechner
Copy link
Contributor

moberwasserlechner commented Nov 26, 2018

If I use a dark splashscreen and test it the app on a iPhone 6 or SE I get a white flicker when the SplashScreen is handed over from the native LaunchScreen.storyboard and to the SplashScreen plugin.

The duration of the flicker depends on the phone.

This new config param would allow me to reduce the flickering for splashscreen images with a small logo in the middle and remove the flickering for splash screens with a solid color.

Entry example for capacitor.config.json

ios {
    backgroundColor: "#000000" or "rgba(0,0,0,1)" // convert it in the viewcontroller
}

rgba or hex color values are easier to configure than the UIColor.

Set the color in CAPBridgeViewController where the wkWebView is initialised.

// get config color an convert it to UIColor(
webView?.backgroundColor = //UIColor(red:0.15, green:0.17, blue:0.22, alpha:1.0)
webView?.scrollView.backgroundColor = //UIColor(red:0.15, green:0.17, blue:0.22, alpha:1.0)

For anyone using the workaround in XCode 10 do "Product / Clean Build Folder" (Cmd + Shift + K) before every build because XCode caches things and you will not see your changes.

Thx & BR, Michael

@moberwasserlechner
Copy link
Contributor Author

moberwasserlechner commented Jan 7, 2019

Other config params are described in #1097

@stewones
Copy link
Contributor

stewones commented Jan 9, 2019

+1 for this, highly needed

@mlynch
Copy link
Contributor

mlynch commented May 19, 2019

Thanks we should fix this for sure especially given the rising popularity of dark UI styles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants