8

I am currently working on a Mobile App project for Ford company, and I am a newbie in Java Android.

I am just wondering, is there any way to decrease the size of rating bar in Android 2.1?

I want to preserve more spaces for other buttons and edittexts.

Thank you in advance for you help

alain.janinm
  • 19,951
  • 10
  • 65
  • 112
Sammm
  • 501
  • 4
  • 9
  • 25

3 Answers3

27

You could try setting style="?android:attr/ratingBarStyleSmall" but the documentation states:

The smaller RatingBar style ( ratingBarStyleSmall) and the larger indicator-only style (ratingBarStyleIndicator) do not support user interaction and should only be used as indicators

Dan Lew
  • 85,990
  • 32
  • 182
  • 176
Mark B
  • 183,023
  • 24
  • 297
  • 295
13

Rating Bar Style can be set. As the previous answer says, documentation says ratingBarStyleSmall is indicator-only style. But I found that I could set it as not an indicator using:-

android:isIndicator="false"
Ayyappa Das
  • 191
  • 1
  • 2
  • 6
0

You can change the size of stars by changing the four attributes in style.xml, for e.g.:

 <style name="RatingBar_style" parent="@android:style/Widget.RatingBar">
    <item name="android:minHeight">30dp</item>
    <item name="android:maxHeight">30dp</item>
    <item name="android:height">25dp</item>
    <item name="android:width">25dp</item>
 </style>

minHeight and maxHeight act like canvas on which stars are placed Change the height and width attributes according to your requirement.

Ashish Kwatra
  • 129
  • 1
  • 5