动作栏下方的Webview进度条?

时间:2015-01-24 14:39:00

标签: android android-webview android-progressbar

我想将进度条放在操作栏下方,现在它位于操作栏的顶部,我搜索了很多但没找到任何相关内容?

这是我的代码......

 public void onCreate(Bundle savedInstanceState) {
            // TODO Auto-generated method stub
            super.onCreate(savedInstanceState);
            this.getWindow().requestFeature(Window.FEATURE_PROGRESS);


            setContentView(R.layout.java);
            getWindow().setFeatureInt(Window.FEATURE_PROGRESS,
                    Window.PROGRESS_VISIBILITY_ON);
            getActionBar().setDisplayHomeAsUpEnabled(true);
             wv = (WebView) findViewById(R.id.javaweb);
            wv.loadUrl("file:///android_asset/iques/javaque.html");
            wv.setWebViewClient(new WebViewClient());
            final Activity MyActivity = this;
            wv.setWebChromeClient(new WebChromeClient() {
                public void onProgressChanged(WebView view, int progress) {
                    // Make the bar disappear after URL is loaded, and changes
                    // string to Loading...

                    MyActivity.setTitle("Loading...");
                    MyActivity.setProgress(progress * 100); // Make the bar
                                                            // disappear after URL
                                                            // is loaded

                    // Return the app name after finish loading
                    if (progress == 100)
                        MyActivity.setTitle("JAVA Question");

1 个答案:

答案 0 :(得分:0)

您可以参考此链接Custom Pogress bar