2010-08-03 110 views
0

我加载图片网址到webview它获取图片以及但我需要显示它的大小调整它意味着要降低高度,帮助我得到降低高度的图像。调整webview内容的大小

回答

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); 
+1

如果你想知道为什么人们不会回答你的问题,那是因为你不要将它们标记为已回答。我不愿意这样做,但认为我会帮助你... – 2010-08-09 12:49:01

2

最干净的,我认为是:

myWebView.getSettings().setBuiltInZoomControls(true);