How can I set the star color of the ratingbar? How can I set the star color of the ratingbar? android android

How can I set the star color of the ratingbar?


The simpliest way:

android:progressTint="@color/color"

Smooth and shiny.


This worked for me:

    Drawable drawable = ratingBar.getProgressDrawable();    drawable.setColorFilter(Color.parseColor("#FFFDEC00"), PorterDuff.Mode.SRC_ATOP);


I've found that just setting the progressTint is not a complete solution. It will change the color of the star but not on partial star fills if your stepSize is less than 1. In my experience you also need to set the secondaryProgressTint in order to stop the default star tint from rearing its ugly head. Here is my code:

android:progressTint="@color/accent"android:secondaryProgressTint="@android:color/transparent"

Hope this helps someone in my situation.