当停止web视图是在最后是在、视图、web

由网友(清风作别)分享简介:我希望能够滚动web视图,直到它已经到达web视图的结束。但是,code以下继续向下滚动,自动即使web视图页面已达到了它的终点。我想确保每个页面滚动,直到web视图的结尾。 webview.loadUrl(文件:/// android_asset /+位置+名.html);。webview.getSettings()...

我希望能够滚动web视图,直到它已经到达web视图的结束。但是,code以下继续向下滚动,自动即使web视图页面已达到了它的终点。我想确保每个页面滚动,直到web视图的结尾。

  webview.loadUrl(文件:/// android_asset /+位置+名.html);
            。webview.getSettings()setBuiltInZoomControls(真正的);
            webview.setPictureListener(新PictureListener(){

                公共无效onNewPicture(web视图来看,画中画){
                    INT WEBBOT = webview.getBottom();

                    webview.scrollBy(0,1);
                }
            });
 

解决方案

,试试这个(基本上使用onPageFinished(),而不是onNewPicture())

  wv.setWebViewClient(新WebViewClient(){
        @覆盖
        公共无效onPageFinished(web视图查看,字符串URL){
             // TODO自动生成方法存根
            super.onPageFinished(查看,网址);
            Log.i(TAG,onPageFinished援引!);
            wv.scrollBy(0,wv.getBottom());
            }

    });
 

cisco 路由器web界面没视图

I want to be able to scroll the webview until it has reached the end of the Webview. But the code below continues to scroll down automatically even when the webview page has reached to it's end. I want to make sure that each page scrolls down until the end of the webview.

webview.loadUrl("file:///android_asset/"+position+".html");
            webview.getSettings().setBuiltInZoomControls(true);
            webview.setPictureListener(new PictureListener() {

                public void onNewPicture(WebView view, Picture picture) {
                    int webBot = webview.getBottom();

                    webview.scrollBy(0, 1);
                }
            });

解决方案

Try this, (Basically using onPageFinished() instead of onNewPicture())

       wv.setWebViewClient(new WebViewClient() {            
        @Override
        public void onPageFinished(WebView view, String url) {
             // TODO Auto-generated method stub
            super.onPageFinished(view, url);
            Log.i(TAG,"onPageFinished invoked!!");
            wv.scrollBy(0, wv.getBottom());
            }

    }); 

阅读全文

相关推荐

最新文章