开发者

How to properly zoom a WebView together with it's background image?

开发者 https://www.devze.com 2023-01-13 21:38 出处:网络
I\'m using the following code which only zooms the loadData. How is it possible to zoom the image inside? Thank you in advance!

I'm using the following code which only zooms the loadData. How is it possible to zoom the image inside? Thank you in advance!

WebView web = (WebView) findViewByI开发者_StackOverflowd(R.id.myid);    
web.loadUrl("file:///android_asset/image.jpg");
web.getSettings().setBuiltInZoomControls(true);
web.setBackgroundColor(0);
web.setVisibility(ImageView.VISIBLE);
web.setBackgroundResource(R.drawable.myimage);


I finally did it by insersting the image.jpg in an html file which took the place of loadUrl().

0

精彩评论

暂无评论...
验证码 换一张
取 消