调整webview内容的大小

时间:2010-08-03 14:32:52

标签: android

我正在将图片网址加载到webview上,它也可以获取图片,但是我需要在resizeable中显示它,这意味着要减少te高度,帮助我降低图像的高度。

2 个答案:

答案 0 :(得分:2)

最干净的,我认为是:

myWebView.getSettings().setBuiltInZoomControls(true); 

答案 1 :(得分:1)

您可以使用缩放显示缩小的图像:

this.getWebView ().getSettings ().setSupportZoom ( true );
View zoom = this.getWebView ().getZoomControls ();
FrameLayout contentView = (FrameLayout) getWindow ().getDecorView ().findViewById ( android.R.id.content );
contentView.addView ( zoom, ZOOM_PARAMS );
zoom.setVisibility ( View.GONE );
// set the initial scale that it should display at. the value is the scale percent
this.getWebView ().setInitialScale ( 75 );