在web视图图像适合屏幕视图、图像、屏幕、适合

2023-09-04 10:24:52 作者:短发小女人ベ也可以很可爱

在我的应用程序,我显示图片感谢一个web视图。因此,对于每个图像创建小的HTML code,我用web视图加载。所以,我的HTML code由基本处于img标签(与路径,我的图片)。

In my app, I display pictures thanks to a webView. So for each image I create small HTML code that I load with the webView. So my html code consist basically in a img tag (with the path to my picture).

我的图片有不同的大小,这就是为什么我希望把我的web视图缩放以适​​应图片宽度与web视图的宽度。因此用户不必做放大或缩小,以便能够看到整个画面

My pictures have different sizes, that's why I'd like to set my webView zoom to fit the pictures width to the webView width. So the user don't have do zoom in or out to be able to see the entire picture.

有没有办法实现呢?

感谢。

推荐答案

如果您正在creaing的HTML code(你说你是),你可以欺骗:

If you are creaing the HTML code (which you say that you are), you can cheat:

在HTML code:

In the html code:

img src="xxx" width="100% >