如何更改android中评分栏非进度条的颜色?

How to change the color of non-progress of rating bar in android?

我在 android 应用程序中使用评级栏,但遇到了问题。我已将评级栏颜色设置为绿色并希望如此,如果评级为 3,则 3 颗星为绿色,最后两颗星不可见。现在,如果等级是 3,那么前三个是绿色,接下来的两个是浅绿色。像这样:

我该如何更改它,如果评分为 3,则最后两颗星不可见。

它不完全是重复的,但我认为您可能正在寻找类似的东西

How to create Custom Ratings bar in Android

因为您需要更改当星星为 "off" 时用于显示的 drawable 以使其成为 "invisible"。 AFAIK Android 目前没有为您提供隐藏掉星的方法。