androidandroid-studioratingbar

RatingBar with pink background when holding


My RatingBar is pretty regular, when selected appears like thisenter image description here

But when touching (and holding) them, all unrated stars are pink, like this

enter image description here

Why does this happen?

The xml:

<RatingBar
    android:id="@+id/ratingBarSchedulesRatingTour"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="4dp"
    android:numStars="5"
    android:progressTint="@color/yellow_star"
    android:secondaryProgressTint="@color/yellow_star"
    android:stepSize="1" />

@color/yellow_star is on colors.xml as #F1CD1E


Solution

  • You can use android:progressBackgroundTint attribute on RatingBar to override background color:

    android:progressBackgroundTint="#ABABAB"