I need insert a space between the stars of my ratingBar, example the ratingbar is well:
but I need it thus:
how i can do this?
I need insert a space between the stars of my ratingBar, example the ratingbar is well:
but I need it thus:
how i can do this?
I agree to Tim i applied same logic and it worked. Here in my project i am using my own star images for the star ratin I made star images having extra space (padding) on the right side that resulted in space between the stars
I think you'd have to grab a copy of the systems star png file and manually add the padding that you want to it with a photoshop / gimp / some other editor.
I don't know if it will be useful anymore, but I made a custom library which allows you to change space beetwen stars programatically and in XML (among other stuff): SimpleRatingBar.
It features:
android:layout_width
: it can be set towrap_content
,match_parent
or abritary dp.Here is a preview of it.
In your case, you would just have to do:
or, for example, in pixels:
You can find it either in
jcenter
or inMaven Central
. So in yourbuild.gradle
file just add to your dependencies:compile 'com.iarcuschin:simpleratingbar:0.1.+'
You have a next property.
@drawable/rating_stars :
star_empty and star are the images which are in your drawable directory. So, you can change star and star_empty in a graphic editor and add a spassing if you need.
Just use the custom icon for it and do use the style , i mean Photoshop it as you want it to look and replace with the system rating style icon.