In my activity I have some Rating bars. But the size of this bar is so big! How can I make it smaller?
Edit
Thanks to Gabriel Negut, I did it with the following style:
<RatingBar
style = "?android:attr/ratingBarStyleSmall"
android:numStars = "5"
android:rating = "4" />
Now, the size is reduced but number of stars and rating do not take effect!!! Why? I have 7 stars that 6 of them is selected.
This was my solution after a lot of struggling to reduce the rating bar in small size without even ugly padding
If you only need the default style, make sure you have the following width/height, otherwise the numStars could get messed up:
Working Example
and add this in your styles xml file
This way you dont need to customise ratingBar.
Check my answer here. Best way to achieve it.
and use like
Using
Widget.AppCompat.RatingBar
, you have 2 styles to use;Indicator
andSmall
for large and small sizes respectively. See example below.