문제

I'm new using CordovaWebView and I have the following problem

When I try to load content into CordovaWebView, first it shows an empty white screen for sometime until it loads it's content.

What I want is to show native loading screen until the CordovaWebView finish loading it's content

Can anyone help here ?

도움이 되었습니까?

해결책

You can override the cordovaWebviewClient present in cordova lib and implement "onPageStarted" and "onPageFinished" methods. In pagestart make progress bar visiblity to visible and on page finish make it to gone.

 public void onPageStarted(WebView view, String url, Bitmap favicon) {
      // TODO Auto-generated method stub
      super.onPageStarted(view, url, favicon);

            progressBar.setVisibility(View.GONE);
     }

     public void onPageFinished(WebView view, String url) {
  // TODO Auto-generated method stub
      super.onPageFinished(view, url);

      progressBar.setVisibility(View.GONE);
     }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top