开发者

using pinch in the webview android

开发者 https://www.devze.com 2023-03-05 20:57 出处:网络
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??

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 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

0

精彩评论

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