質問

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