andriod 利用WebView实现 图片放大缩小以及移动[转]

抛弃以前用ImageView的陈旧观念吧。

利用WebView加载本地图片,仅需两步,马上完成。

String imgpath=".../test.jpg";

WebView vb=(WebView)findViewById(R.id.mywebview);

vb.getSettings().setBuiltInZoomControls(true);

vb.loadURL(imgpath);

//vb.loadUrl("file:///android_asset/icon.png");

猜你喜欢

转载自yxwang0615.iteye.com/blog/1706618