Tim*_*nah 5 android zoom local webview pinch
嘿,我正试图在我的应用程序的Webview上缩放工作但不能,它只是显示图像真正放大(可能显示100%)
这是我如何让webview工作.
在我添加的活动中
WebView mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("file:///android_asset/sitemap.png");
Run Code Online (Sandbox Code Playgroud)
该图像位于assets文件夹中,名为sitemap.png
我用于webview的布局xml是
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
Run Code Online (Sandbox Code Playgroud)
我没有在代码中添加任何其他内容.你能告诉我什么不起作用,说它完美显示图片但我不能捏缩放,什么是解决这个问题的最简单的方法,因为我是nooby
干杯
Phi*_*hil 11
在API 3中,您可以使用setBuiltInZoomControls:
webView.getSettings().setBuiltInZoomControls(true);
Run Code Online (Sandbox Code Playgroud)
另请参阅: 在WebView中禁用缩放缩放?