在web视图图像适合屏幕 [英] Image fit screen in a WebView

查看:106
本文介绍了在web视图图像适合屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,我显示图片感谢一个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% >

这篇关于在web视图图像适合屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆