1Android 自定义Diglog
Android自定义类似ProgressDialog效果的Dialog.
方法如下:
1.首先准备两张自己要定义成哪样子的效果的图片和背景图片(也可以不要背景)。
如我要的效果:
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200703204012394.png)
2.定义loading_dialog.xml布局文件(这里你也可以按自己的布局效果定义,关键是要有个imageView):
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200703204203856.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0phY2tDaGVuQQ==,size_16,color_FFFFFF,t_70)
3.定义一个loadingDialog中imageView转动的动画:loading_animation.xml
![撤销:Ctrl/Command + Z重做:Ctrl/Command + Y加粗:Ctrl/Command + B斜体:Ctrl/Command + I标题:Ctrl/Command + Shift + H无序列表:Ctrl/Command + Shift + U有序列表:Ctrl/Command + Shift + O检查列表:Ctrl/Command + Shift + C插入代码:Ctrl/Command + Shift + K插入链接:Ctrl/Command + Shift + L插入图片:Ctrl/Command + Shift + G查找:Ctrl/Command + F替换:Ctrl/Command + G](https://img-blog.csdnimg.cn/20200703204307380.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0phY2tDaGVuQQ==,size_16,color_FFFFFF,t_70)
4.定义dialog的style
![直接输入1次#,并按下space后,将生成1级标题。输入2次#,并按下space后,将生成2级标题。以此类推,我们支持6级标题。有助于使用语法后生成一个完美的目录。](https://img-blog.csdnimg.cn/20200703204403671.png)
5.写点创建Dialog的代码,你可以自己封装成一个方法
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200703204519450.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0phY2tDaGVuQQ==,size_16,color_FFFFFF,t_70)
!