我通过将pdf网址附加到google doc api来加载WebView中的pdf文档
http://docs.google.com/gview?embedded=true\u0026amp;url=myurl
Pdf正在加载,但网页显示两个选项 – 放大和弹出.有没有办法通过发送一些参数来禁用/隐藏弹出选项?任何帮助将不胜感激.谢谢提前!
解决方法
//initialze WebView webview = (WebView) findViewById(R.id.fullscree_webview); //set the javascript enable to your webview webview.getSettings().setJavaScriptEnabled(true); //set the WebViewClient webview.setWebViewClient(new WebViewClient() { //once the page is loaded get the html element by class or id and through javascript hide it. @Override public void onPageFinished(WebView view,String url) { super.onPageFinished(view,url); webview.loadUrl("javascript:(function() { " + "document.getElementsByClassName('ndfHFb-c4YZDc-GSQQnc-LgbsSe ndfHFb-c4YZDc-to915-LgbsSe VIpgJd-TzA9Ye-eEGnhe ndfHFb-c4YZDc-LgbsSe')[0].style.display='none'; })()"); } })