ratingbar not working (not clickable) when using ratingBarStyleSmall style

soulhi salah picture soulhi salah · Jun 19, 2016 · Viewed 11.9k times · Source

ratingbar didn't change when the user click on it ?

her is my xml code

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.soulhis.testmaterialdesign.Test">
<RatingBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/ratingBar4"
    android:layout_centerVertical="true"
    style="?android:attr/ratingBarStyleSmall"
     android:layout_centerHorizontal="true" />
 </RelativeLayout>

the problem occur just when using ratingBarStyleSmall tested on android jellybean api level 17

Answer

Pouya Danesh picture Pouya Danesh · Dec 9, 2017

so I had the same issue and I put android:isIndicator="false" to my RatingBar tag and it solved the problem for me now my full rate bar tag looks like this:

<RatingBar
    android:id="@+id/ratingReview"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:numStars="5"
    android:isIndicator="false"
    style="@style/Base.Widget.AppCompat.RatingBar"/>

hope this helps. for more info you can refer to this answer too.