Android WebView, Scaling Image to fit the screen

前端 未结 9 1129
醉梦人生
醉梦人生 2020-11-29 01:13

What I have: I\'m loading image from a URL. I simply do (WebView).loadUrl(imageurl, extraheaders)

What I get: Image i

9条回答
  •  失恋的感觉
    2020-11-29 01:51

    Its a bit late but I hope this will help, what you can do is:

    String html = "";
    mWebView.loadData(html, "text/html", null);
    

    this will make the image exactly similar to your WebView's width, rest you can adjust the WebView itself.

提交回复
热议问题