using pinch in the webview android
I have two questions:
I find this code to use pinch in the
webImageView
but when I changewebImageView
byWebView
. I obtain an error in the code. how I use pinch in thewebview
??// create the WebImageView object from xml WebImageView img = (WebImageView) findViewById(R.id.main_pic); // fetches the image in a background thread img.setImageFromURL("http://www.mysite.com/mypicture.jpg"); // enable pinch-zoom abilities on the image new PinchImageView(img);
When I add pinch in my code is tha开发者_Python百科t supported by all the mobile android or you should have a specific screen to make it work it.
You can enable zooming in a WebView by following WebView setting
mWebView.getSettings().setBuiltInZoomControls(true);
Also you can set the default zoom level by using ZoomDensity
mWebView.getSettings().setDefaultZoom(WebSettings.ZoomDensity.CLOSE);
Have you added the referencing library of Nikko? http://code.google.com/p/android-pinch/wiki/PinchImageView
精彩评论