How to change the color of an indefinite ProgressBar?

后端 未结 7 911
萌比男神i
萌比男神i 2020-12-14 17:50

I have a progressbar with the following style: style=\"?android:attr/android:progressBarStyleSmall\"

Sadly the bar is nearly white and in my case displ

7条回答
  •  旧时难觅i
    2020-12-14 18:10

    progressBar.getIndeterminateDrawable().setColorFilter(
                getResources().getColor(R.color.light_light_purple),
                android.graphics.PorterDuff.Mode.SRC_IN);
    

    This code changes the default holo inderminate drawable color to your own color. Define your color code and replace R.color.light_light_purple to R.color.your_color_code.

提交回复
热议问题