我想顯示自定義對話框,如iphone hud進度欄樣式。但是,我不知道創建自定義對話框像hud進度條像iPhone上的android。我想要顯示自定義對話框像iphone HUD進度條
我想自定義對話框如下圖所示的圖像:
幫助我......!
謝謝......!
我想顯示自定義對話框,如iphone hud進度欄樣式。但是,我不知道創建自定義對話框像hud進度條像iPhone上的android。我想要顯示自定義對話框像iphone HUD進度條
我想自定義對話框如下圖所示的圖像:
幫助我......!
謝謝......!
我創建了一個樣本Android應用程序,以及可以用於此目的的ProgressHUD類。你可以在這裏找到它: https://github.com/anupamdhanuka/AndroidProgressHUD
非常感謝老闆......! – 2013-05-18 10:05:27
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();
只要看看這個(我的)圖書館。 IOSDialog/Spinner library
這是非常容易使用和解決您的問題。有了它,你可以很容易地創建和使用微調像iOS一樣。 的代碼示例:
final IOSDialog dialog1 = new IOSDialog.Builder(IOSDialogActivity.this)
.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
dialog0.show();
}
})
.setDimAmount(3)
.setSpinnerColorRes(R.color.colorGreen)
.setMessageColorRes(R.color.colorAccent)
.setTitle(R.string.standard_title)
.setTitleColorRes(R.color.colorPrimary)
.setMessageContent("My message")
.setCancelable(true)
.setMessageContentGravity(Gravity.END)
.build();
final IOSDialog dialog0 = new IOSDialog.Builder(IOSDialogActivity.this)
.setTitle("Default IOS bar")
.setTitleColorRes(R.color.gray)
.build();
結果:標準IOS對話框
@ArtjomB。感謝您的建議。我表示這是我的圖書館。附圖是附件,但由於我的名譽很低,我只能留下鏈接。 – Samehadar 2017-06-17 15:12:20
鏈接很好,因爲圖片很大並且有點分散注意力。 – 2017-06-17 16:26:25
首先也是最事情,**每個平臺都有自己的標準,用戶界面和編程**。 – 2012-07-10 06:09:38