Reputation: 43
I have two questions:
I find this code to use pinch in the webImageView
but when I change webImageView
by WebView
. I obtain an error in the code. how I use pinch in the webview
??
// 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 that supported by all the mobile android or you should have a specific screen to make it work it.
Upvotes: 1
Views: 1544
Reputation: 436
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);
Upvotes: 2
Reputation: 11
Have you added the referencing library of Nikko? http://code.google.com/p/android-pinch/wiki/PinchImageView
Upvotes: 1