Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用这个 URL 显示一张图片:
String htmlData= "<Html><head></head><body><p style="text-align:center"> <img src="//img10.xxx.com/xxx.jpg" /><br/></p></body></html>"; mWebView.loadData(htmlData, "text/html; charset=UTF-8", null);
但无法显示。
如何解决这个问题呢?
您可以尝试loadDataWithBaseURL()提供具有正确方案的 URL。
loadDataWithBaseURL()
否则,修复 HTML 以提供关于该src属性的方案。loadData()不知道该协议相对 URL 使用什么方案。
src
loadData()