Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ratingbar not working (not clickable) when using ratingBarStyleSmall style

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

like image 823
soulhi salah Avatar asked Jun 19 '16 13:06

soulhi salah


1 Answers

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.

like image 74
Pouya Danesh Avatar answered Sep 18 '22 14:09

Pouya Danesh