嗨,我已使用以下代码进行内置放大缩小控制
mWebView = (WebView) findViewById(R.id.webView1);
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.getSettings().setSupportZoom(true);
我也使用了如下代码
mWebView.setWebViewClient(new MyWebViewClient());
mWebView.loadUrl(sabNZBurl);
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.getSettings().setSupportZoom(true);
backwardBtn = (Button) findViewById(R.id.btnBackWard);
cancelBtn = (Button) findViewById(R.id.btnCancel);
refreshBtn = (Button) findViewById(R.id.btnRefresh);
forwardBtn = (Button) findViewById(R.id.btnForward);
backwardBtn.setOnClickListener(this);
cancelBtn.setOnClickListener(this);
refreshBtn.setOnClickListener(this);
forwardBtn.setOnClickListener(this);
final class MyWebViewClient extends WebViewClient {
@Override
// Show in WebView instead of Browser
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
@Override
public void onLoadResource(WebView view, String url) {
super.onLoadResource(view, url);
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
PD.dismiss();
view.getSettings().setBuiltInZoomControls(true);
view.getSettings().setSupportZoom(true);
}
}
但是 webview 仍然没有内置放大缩小控制,任何人都可以帮我解决这个问题