在我的项目中,我有启动画面和WKWebViewController。启动画面后,在WkWebViewController中重定向并打开一个URL。但是在启动屏幕2-3秒后,出现一个白色屏幕,然后加载网页。我要删除此白色屏幕或更改该屏幕的颜色。我的网页代码是:
class ViewController: UIViewController , WKNavigationDelegate {
@IBOutlet weak var webview: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
webview.navigationDelegate = self
}
override func viewWillAppear(_ animated: Bool) {
loveredioweb()
}
func loveredioweb() {
let url = "URL"
let request = URLRequest(url: URL(string: url)!)
self.webview.load(request)
}
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
SVProgressHUD.show()
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
SVProgressHUD.dismiss()
}
func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
SVProgressHUD.dismiss()
}
}