WKWebView fails to load images and CSS using loadHTMLString(_, baseURL:)

前端 未结 10 841
抹茶落季
抹茶落季 2020-12-14 14:05

Apple\'s recommendation:

In apps that run in iOS 8 and later, use the WKWebView class instead of using UIWebView.

Thus, I have r

10条回答
  •  鱼传尺愫
    2020-12-14 14:59

    Personally, I had to switch to using XWebView as the out-of-the-box behavior of WKWebView does not allow loading of local files. XWebView tricks it by loading up a local web server in the background and directing local traffic thru it. (XWebView is based on top of WKWebView)

    Seems a bit overkill, but that is what I ended up having to do.

提交回复
热议问题