How to change default ProgressDialog circle color in android

前端 未结 10 968
夕颜
夕颜 2020-12-24 11:01

I am using ProgressDialog for showing progressbar

            ProgressDialog progressDialog = new ProgressDialog(context);
            progress         


        
10条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-24 11:54

    Get the resource from the android resource that being used by the ProgressDialog.

    final ProgressDialog progress = new ProgressDialog(context);
    progress.setTitle("Loading");
    progress.setMessage("Wait while loading...");
    progress.setCancelable(false); // disable dismiss by tapping outside of the dialog
    progress.show();
    ProgressBar progressbar=(ProgressBar)progress.findViewById(android.R.id.progress);
    progressbar.getIndeterminateDrawable().setColorFilter(Color.parseColor("#C60000"), android.graphics.PorterDuff.Mode.SRC_IN);
    

提交回复
热议问题