现在的位置: 首页 > 综合 > 正文

[WebView] How to display local images from a remotely loaded URL web page?

2014年01月14日 ⁄ 综合 ⁄ 共 418字 ⁄ 字号 评论关闭

1,pages loaded by loadUrl() method do not load images linked with file:///android_asset/... but you can fetch the HTML page using org.apache.http.client.methods.HttpGet.HttpGet() and then pass it to the WebView
with loadDataWithBaseURL() - that way WebView will load resources linked with file:///android_asset/...,


2,

You could use base64 embedded images in your page content (no need to struggle with links to restricted filesystem)

<img src="data:image/jpg;base64,xxxxxxxxx"/>

抱歉!评论已关闭.