I have a progressbar with the following style: style="?android:attr/android:progressBarStyleSmall"
Sadly the bar is nearly white and in my case displayed on a white background. The progressbar is nearly invisible because of that.
How can I change the color of the progressbar? A darker grey would be great.
Indeterminate mode is the default for progress bar and shows a cyclic animation without a specific amount of progress indicated. The following example shows an indeterminate progress bar: <ProgressBar android:id="@+id/indeterminateBar" android:layout_width="wrap_content" android:layout_height="wrap_content" />
In Android, by default a progress bar will be displayed as a spinning wheel but If we want it to be displayed as a horizontal bar then we need to use style attribute as horizontal. It mainly use the “android. widget. ProgressBar” class.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With