I wanted to know how to change the color of the progress of a circular ProgressBar (not the one that is a bar)
the code of my progress bar
android:id="@+id/pg_bar"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_gravity="center"
android:layout_marginTop="25dp"
defines the property
android:background
, which in this case does not work asbackground
delProgressBar
but as the color of the element:inside your /drawable folder (inside /res) create the file that defines the background and contains your custom color
mipbstyle.xml
:Modifying your progressBar a bit it would look like:
or programmatically by:
In both cases you would get something similar to:
Here they comment on how to change it by link code , I imagine that is what you are asking for.
in your xml
And in res/values/styles.xml:
And custom_progress_bar_horizontal is an XML stored in the drawable folder that defines the custom progress bar. I hope this will help you.
what you did was good but you made a mistake when calling the layout of your progressbar. It really helped me, thanks this is my code