慕容708150
检查一下webview的方法调用对没有!网页脚本js运行出错,webView.setWebViewClient用WebViewClient的onPageFinished(WebView view, String url)方法会监听到网页加载完成,如果显示不完整,就应该去找网页怎么写的。WebViewClient的方法说明1、publicboolean shouldOverrideUrlLoading(WebView view, String url) {view.loadUrl(url);return true;}在点击请求的是链接是才会调用,重写此方法返回true表明点击网页里面的链接还是在当前的webview里跳转,不跳到浏览器那边。2、publicvoid onReceivedSslError(WebView view, SslErrorHandler handler,android.net.http.SslError error) {handler.proceed();}重写此方法可以让webview处理https请求。3、publicboolean shouldOverrideKeyEvent(WebView view, KeyEvent event) {return super.shouldOverrideKeyEvent(view, event);}}重写此方法才能够处理在浏览器中的按键事件。4、public void onLoadResource(WebView view, String url) {// TODO Auto-generated method stubif (DEBUG) {Log.d(TAG, " onLoadResource ");}super.onLoadResource(view, url);}在加载页面资源时会调用,每一个资源(比如图片)的加载都会调用一次。5、public void onPageStarted(WebView view, String url, Bitmap favicon) {// TODO Auto-generated method stubif (DEBUG) {Log.d(TAG, " onPageStarted ");}if (url.endsWith(".apk")) {download(url);//下载处理}super.onPageStarted(view, url, favicon);}在页面加载开始时调用。6、publicvoid onPageFinished(WebView view, String url) {// TODO Auto-generated method stubif (DEBUG) {Log.d(TAG, " onPageFinished ");}super.onPageFinished(view, url);}在页面加载结束时调用。webview介绍的原文如下:A View that displays web pages. This class is the basis upon which you can roll your own web browser or simply display some online content within your Activity. It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history, zoom in and out, perform text searches and more.从上面你应该了解到了基本功能,也就是显示网页。之所以我说webview功能强大是因为它和js的交互非常方便,很简单就可以实现。