简体   繁体   中英

Android RatingBar with ratingBarStyleIndicator theme and rating less 0.5

RatingBar with ratingBarStyleIndicator theme applied doesn't want to show values less than 0.5, it shows them as 0.5. But all is ok with greater values like 0.6..1. When style is default behavior is right. Do you know the reason?

I was having the same problem. The behaviour seems to depend on a combination of the amount of transparent pixels around the 'star' image being used, and the device the app is running on (eg sometimes it doesn't go below 0.5 on the emulator, but goes to zero on my actual phone).

The workaround I found is to include a good chunk of blank space to the left of the ratingbar. Eg try adding...

android:layout_marginLeft="10dp" 

...and if that works, experiment to see how much you can close up the gap and still get the reading down to zero.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM