开发者

How can I reference a file in my drawable folder to put in WebView in android?

开发者 https://www.devze.com 2022-12-31 21:31 出处:网络
For example, I want to make开发者_开发问答 an image appear in webview to utilize the zoom functions.

For example, I want to make开发者_开发问答 an image appear in webview to utilize the zoom functions. I would use this line of code:

this.myWebView.loadUrl("file://");

I just need to know what to put after file to reference the image.


you would have to use the data uri and base64 encode the image bytes. the Uri would look something like this:

this.myWebView.loadUrl("data:image/png;base64,<base64DataHere>");
0

精彩评论

暂无评论...
验证码 换一张
取 消