我创建了一个Custom ProgressDialog,如下所示:
首先,我有一个包含9个连续Imges的动画列表
然后我有一个自定义的风格
@null
@null
true
@null
@null
stateUnspecified|adjustPan
false
center
70dip
80dip
现在在代码中我将其称为如下
dialog = new ProgressDialog(KaguaHome.this);
dialog.setProgressStyle(R.style.CustomDialog);
dialog.setIndeterminate(true);
dialog.setIndeterminateDrawable(getResources().getDrawable(R.drawable.progress_dialog_icon_drawable_animation));
dialog.show();
结果是
然而,我想要只用图像(没有白色背景)来实现进度对话框,它应该居中,我应该修改什么?
解决方法:
试试这个并说出它是如何工作的.我试过这个,对我而言它就是中心.
@null
@android:color/transparent
true
@null
@null
@android:style/Animation.Dialog
stateUnspecified|adjustPan
true
@android:color/transparent
@anim/progress_dialog_icon_drawable_animation
并声明为
customDialog = new Dialog(getActivity(),R.style.NewDialog);
看看这是否有效.
标签:android,progressdialog
来源: https://codeday.me/bug/20190529/1177877.html