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
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.
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.
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.
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
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"
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