ProgressDialog dialog = ProgressDialog.show(ctx,null,null);
dialog.getWindow().setGravity(Gravity.CENTER);
dialog.setContentView(new ProgressBar(ctx));
dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
我需要更改加载圈的颜色
答案 0 :(得分:0)
<style name="DialogStyle" parent="Theme.AppCompat.Light.Dialog">
<item name="colorPrimary">@color/YOUR_COLOR</item>
</style>
并设置为对话框:
ProgressDialog progressDialog = new ProgressDialog(MainActivity.this, R.style.DialogStyle);