Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decrease the size of Rating Bar in Android 2.1

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

like image 450
Sammm Avatar asked Sep 21 '10 23:09

Sammm


People also ask

How do I change the rating bar on my android?

You can create custom material rating bar by defining drawable xml using material icon of your choice and then applying custom drawable to rating bar using progressDrawable attribute. Below drawable xml uses thumbs up icon for rating bar. Show activity on this post.

What is Rating bar in android user interface?

android.widget.RatingBar. A RatingBar is an extension of SeekBar and ProgressBar that shows a rating in stars. The user can touch/drag or use arrow keys to set the rating when using the default size RatingBar.

How to add Rating bar in android studio?

Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml. In the above code, we have declared Rating bar and set numStars as 5 means it allows maximum number of stars 5 and button.


2 Answers

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

like image 103
Mark B Avatar answered Nov 10 '22 03:11

Mark B


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"
like image 31
Ayyappa Das Avatar answered Nov 10 '22 05:11

Ayyappa Das