本文介绍了Android Webview:对于屏幕而言太大的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一种使图像显示在最初适合屏幕的WebView中的方法,而不是显示实际大小.有办法吗?
I'm looking for a way to have images appear in a WebView that initially fits the screen, instead of showing the actual size. Is there a way to do this?
如果有以下情况,它有何不同
How is it different if:
1)我打开了一个带有图像img标签的html文件
1) I open an html file with an img tag to the image
2)我直接打开图像文件
2) I open the image file directly
感谢您的帮助.
推荐答案
我最终使用了:
mWebView.getSettings().setLoadWithOverviewMode(true);
mWebView.getSettings().setUseWideViewPort(true);
使页面的内容适合WebView.
To make the contents of the page fit to the WebView.
这篇关于Android Webview:对于屏幕而言太大的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!