Phonegap + Jquery モバイルを使用して Android アプリケーションに取り組んでおり、アプリの起動時にスプラッシュ画面が 1 つ表示されますが、それは静的な png ファイルです。現在、顧客はスプラッシュ画面のスピナーやプログレス バーなどの読み込みインジケーターを要求し続けています。ユーザーがアプリのロードを待っている間。
スプラッシュ画面に進行状況バーを表示するために 1 つの例に従いますが、それは機能しません。それは私のコードです。
メイン Java:
super.onCreate(savedInstanceState);
final Activity activity = this;
final ProgressBar progessBar1;
View footer = View.inflate(getContext(), R.layout.spinner, null);
root.addView(footer);
progessBar1 = (ProgressBar) findViewById(R.id.progressBar1);
this.appView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
activity.setProgress(progress * 1000);
if(progress < 100 && progessBar1.getVisibility() == ProgressBar.GONE) {
progessBar1.setVisibility(ProgressBar.VISIBLE);
}
progessBar1.setProgress(progress);
if(progress == 100) {
progessBar1.setVisibility(ProgressBar.GONE);
}
Log.d("Progress", progress+"");
}
});
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.setStringProperty("loadingDialog", "Wait, loading packages ...");
super.loadUrl("file:///android_asset/www/index.html", 12000);
super.setIntegerProperty("loadUrlTimeoutValue", 12000);
res/layout の spinner.xml :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ProgressBar
android:id="@+id/progressBar1"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:maxHeight="10dip"
android:minHeight="10dip" />
</LinearLayout>
しかし、進行状況バーは表示されません。
私の質問:
誰でも私が間違っていた場所を指摘するのを助けることができます、ありがとう。
これを行う他の方法は、実際には、スプラッシュ画面にスピナーを表示したいだけです。