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?
android:attr/ratingBarStyleSmall" or scaleX/scaleY the click interaction with RatingBar is disabled. This works for me. Hope this helps you!
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With