系统提供的各种Dialog太复杂!来个最简单的,看图:
[img]http://dl.iteye.com/upload/attachment/422710/a8f1a2fd-ca89-3e5f-8ae2-64d7f13c487e.png[/img]
简单吧!
实现:
上面的代码中主要用到了Theme_TransparentDialog,他的定义见下面:
over!
[url]http://gundumw100.iteye.com/admin/blogs/869742[/url]
spots-dialog:移动加载提示的自定义Android AlertDialog
[url]http://www.open-open.com/lib/view/open1434528013192.html[/url]
[img]http://dl.iteye.com/upload/attachment/422710/a8f1a2fd-ca89-3e5f-8ae2-64d7f13c487e.png[/img]
简单吧!
实现:
private Dialog dialog;
private void showProgress() {
if(dialog == null) {
dialog = new Dialog(this,R.style.Theme_TransparentDialog);
// dialog.setContentView(R.layout.progress_dialog);
dialog.setContentView(new ProgressBar(this));
dialog.setCancelable(true);
dialog.show();
}
}
private void closeProgress() {
if(dialog != null) {
dialog.cancel();
dialog = null;
}
}
上面的代码中主要用到了Theme_TransparentDialog,他的定义见下面:
<style name="Theme_TransparentDialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
over!
[url]http://gundumw100.iteye.com/admin/blogs/869742[/url]
spots-dialog:移动加载提示的自定义Android AlertDialog
[url]http://www.open-open.com/lib/view/open1434528013192.html[/url]