I am making an iOS Webview App with WkWebview.
and my app has own theme color (gray).
So my launchscreen and web site’s background is all gray.
But there is a problem.
My App screen color becomes white between launchscreen end and webview load.
Q1.
Is there a solution that can keep launch screen while webview load?
Q2.
Or is there a solution that can change WkWebview load background color white to gray?
3
Answers
A1. As I know there is no such solution.
A2. You can put your WkWebView on another view (with gray background) and make WkWebView transparent as shown below. So your WkWebView will be transparent until the webpage will not be loaded.
I hope this will help.
Yes, You can create your own splash screen controller and dismiss it once webview finishes loading.
Step 1 – On
applicationDidFinishLaunching
method create a splashviewController and make it mainrootviewController
ofwindow
.Step 2 – Start loading URL in web view and add
delegate
callbacks to find out webpage finished loading.Step 3 – Remove Splash controller from the window and make
webviewController
asrootController
Hope this clears your doubt. If not let me know
//Xcode13