Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/208.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在webview android中使用pinch_Android_Webview_Pinch - Fatal编程技术网

在webview android中使用pinch

在webview android中使用pinch,android,webview,pinch,Android,Webview,Pinch,我有两个问题: 我发现这段代码在webImageView中使用了pinch,但是当我通过WebView更改webImageView时。我在代码中得到一个错误。如何在webview中使用pinch // create the WebImageView object from xml WebImageView img = (WebImageView) findViewById(R.id.main_pic); // fetches the image in a background thread

我有两个问题:


  • 我发现这段代码在
    webImageView
    中使用了pinch,但是当我通过
    WebView
    更改
    webImageView
    时。我在代码中得到一个错误。如何在
    webview
    中使用pinch

     // 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);
    
  • 当我在我的代码中添加pinch时,所有的移动android都支持它,或者你应该有一个特定的屏幕来让它工作


您是否添加了日兴的参考库?

您可以按照WebView设置在WebView中启用缩放

mWebView.getSettings().setBuiltInZoomControls(true);
还可以使用ZoomDensity设置默认缩放级别

mWebView.getSettings().setDefaultZoom(WebSettings.ZoomDensity.CLOSE);

“我在代码中获得了一个错误。”。。。怎么会有人知道那里发生了什么?请显示代码和错误日志。错误不是在我运行代码时发生的。当我写图像时,新的PinchImageView(webview);我应该改变网络视图。