Artemis-a
Artemis-a

Reputation: 55

Android rating bar only show one star

I am using Android default rating bar, but on some devices (Samsung), it only shows one star as you see in the photos. I don't know what is causing this issue and how to resolve it. Appreciate your help.

<RatingBar
        android:id="@+id/ratingBar"
        android:layout_below="@+id/questionText"
        android:layout_marginTop="10dp"
        android:numStars="5"
        android:stepSize="1"
        android:max="5"
        android:theme="@style/RatingBar"
        android:layout_centerHorizontal="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

enter image description here

Upvotes: 1

Views: 696

Answers (1)

stevesw
stevesw

Reputation: 1065

Found it! I was able to reproduce this issue on a Samsung device running Android 9 after enabling Settings -> Advanced features -> Video enhancer, and fixed it by disabling hardware acceleration on all RatingBars as described here:

ratingBar.setLayerType(View.LAYER_TYPE_SOFTWARE, null)

Upvotes: 6

Related Questions