Tinting ProgressBar
suggest changeUsing an AppCompat theme, the ProgressBar
’s color will be the colorAccent
you have defined.
To change the ProgressBar
color without changing the accent color you can use theandroid:theme
attribute overriding the accent color:
<ProgressBar android:theme="@style/MyProgress" style="@style/Widget.AppCompat.ProgressBar" /> <!-- res/values/styles.xml --> <style name="MyProgress" parent="Theme.AppCompat.Light"> <item name="colorAccent">@color/myColor</item> </style>
To tint the ProgressBar
you can use in the xml file the attributes android:indeterminateTintMode
and android:indeterminateTint
<ProgressBar android:indeterminateTintMode="src_in" android:indeterminateTint="@color/my_color" />
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents