Clem Clem - 4 months ago 23x
Android Question

How to make a smaller RatingBar?

I've added a RatingBar in a layout :

<RatingBar android:id="@+id/ratingbar"

But the default style for the rating bar is too large.
I've trie to change it by adding the android style :

But the result is too small and it's impossible to set a rate with this property.

How could i do?


The default RatingBar widget is sorta' lame.

The source makes reference to style "?android:attr/ratingBarStyleIndicator" in addition to the "?android:attr/ratingBarStyleSmall" that you're already familiar with. ratingBarStyleIndicator is slightly smaller but it's still pretty ugly and the comments note that these styles "don't support interaction".

You're probably better-off rolling your own. There's a decent-looking guide at showing how to do this. (I haven't done it myself yet, but will be attempting in a day or so.)

Good luck!

p.s. Sorry, was going to post a link to the source for you to poke around in but I'm a new user and can't post more than 1 URL. If you dig your way through the source tree, it's located at frameworks/base/core/java/android/widget/