Android: Ratingbar not visible, becomes visible only on touching Android: Ratingbar not visible, becomes visible only on touching android android

Android: Ratingbar not visible, becomes visible only on touching


After a bit of research tried my luck and it worked!!! Finally found a solution!

Adding these attributes to saved my life!!!

android:progressBackgroundTint="@color/colorAccent"android:progressTint="@color/colorAccent"android:secondaryProgressTint="@color/colorAccent"

Example:

<android.support.v7.widget.AppCompatRatingBar        android:id="@+id/ratingBar"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:progressBackgroundTint="@color/colorAccent"        android:progressTint="@color/colorAccent"        android:secondaryProgressTint="@color/colorAccent"        android:rating="4" />

You can change these colors according to your needs!!

Extra info:

android:progressTint used for actual progress color

android:secondaryProgressTint used for secondary progress that is when a partial rating selected say half the other half colored using this attribute.

android:progressBackgroundTint used for rest of the rating say 3 out of 5 so last 2 colored this one!

Happy coding!! Eat drink Android! ;)


According to this issue on google code, try to add that lines to your RatingBar properties:

android:isIndicator="true"style="?android:attr/ratingBarStyleIndicator"

Or probably some of that styles:

style="?android:attr/ratingBarStyle"

or

style="android:attr/ratingBarStyleSmall"

As you can see there are no answer from google developers, so I don't know why this weird behavior appears, but maybe it helps.


Without all layout file it's impossible to solve this problem , but if happen only in Lollipop or Marshmallow can be elevation problem. Try set to rating bar "elevation:10dp"