The issue of local webview load a blank html

 I am the manager threw a html, so I loaded with the webview, thought such a simple and direct a new demo, written a few lines of code

I found loads of local html open a blank, in order not to be hate, I first wrote a test html found no problem testing, think of it is not a problem certificate, because the manager gave me the html heard him say some It will prompt insecure connection, and then I added a point Code

This is mainly used to trust all, but found out after this or not, then I am a bit ignorant to force open actually is a blank, wit my f12 directly in the browser to open debug mode that actually have 17 wrong, basically repeat this
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

Baidu said the next is probably not need to set up cross-domain this property in websetting, ok finally resolved

webSetting.setAllowUniversalAccessFromFileURLs (true);
In addition, some friends may say a few words to say about how the assets created, select the mian right
otherwise specifically noted that while assets created when loaded but still have to get rid of this s or else you will be prompted to load error, Can not find the address.

Guess you like

Origin www.cnblogs.com/dianziyihao/p/12446609.html