Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to make fixed ratingbar?

Tags:

android

I am getting rating from the web and want to show the rating by ratingbar.

But my problem is rating of ratingbar is changing when I slide a ratingbar.

I want the rating is fixed and do not changed by user's touch.

is anybody able to limit control of ratingbar? How can I do that?

like image 922
Seho Lee Avatar asked Feb 23 '12 02:02

Seho Lee


People also ask

How can a user be prevented from changing the rating of a RatingBar widget?

android:attr/ratingBarStyleSmall" or scaleX/scaleY the click interaction with RatingBar is disabled. This works for me. Hope this helps you!

How do I change the rating bar on my Android?

Custom Rating Bar in AndroidCopy your images in the drawable folder and remember image size should be according to the size you want. Step 2. Make XML for the rating bar selector in the drawable folder like below. We made two files, one for the fill or highlighted part and one for the empty or un-highlighted part.


1 Answers

Use android:isIndicator="true" in your layout or setIsIndicator(boolean isIndicator) from code to prevent user interaction with the RatingBar widget.

Quote from the docs:

android:isIndicator - Whether this rating bar should only be an indicator (thus non-changeable by the user).

like image 114
MH. Avatar answered Oct 17 '22 05:10

MH.