9

iPhone hud プログレス バー スタイルのようなカスタム ダイアログを表示したいのですが、android の iphone のような hud プログレス バーのようなカスタム ダイアログを作成する方法がわかりません。

以下の画像のようなカスタム ダイアログが必要です。

ここに画像の説明を入力

助けて…!

ありがとう...!

4

3 に答える 3

23

この目的で使用できるサンプル Android アプリケーションと ProgressHUD クラスを作成しました。ここで見つけることができます: https://github.com/anupamdhanuka/AndroidProgressHUD

于 2012-07-10T06:02:57.840 に答える
-1
       private class loadassync extends
        AsyncTask<String, Void, Void> {

    private final ProgressDialog dialog = new ProgressDialog(
            classname.this);

    protected void onPreExecute() {

        this.dialog.setMessage("loading.....");
        this.dialog.show();
    }

    protected Void doInBackground(final String... args) {

        //add the logic while loading
    }

    protected void onPostExecute(final Void unused) {

        try {
            //add the logic after loading
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        if (this.dialog.isShowing()) {
            this.dialog.dismiss();
        }

    }
}

assynctask を実行する

     Loadassync mAssyn1 = new LoadAssync();
                mAssyn1.execute();
于 2012-04-25T08:10:11.787 に答える