系统提供的各种Dialog太复杂!来个最简单的,看图:
简单吧!
实现:
上面的代码中主要用到了Theme_TransparentDialog,他的定义见下面:
over!
http://gundumw100.iteye.com/admin/blogs/869742
spots-dialog:移动加载提示的自定义Android AlertDialog
http://www.open-open.com/lib/view/open1434528013192.html
简单吧!
实现:
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!
http://gundumw100.iteye.com/admin/blogs/869742
spots-dialog:移动加载提示的自定义Android AlertDialog
http://www.open-open.com/lib/view/open1434528013192.html