Android 按住时带有粉红色背景的分级条
我的评级栏非常规则,当被选中时显示如下 但当触摸(并握住)它们时,所有未评级的星星都是粉红色的,就像这样 为什么会发生这种情况 xml:Android 按住时带有粉红色背景的分级条,android,android-studio,ratingbar,Android,Android Studio,Ratingbar,我的评级栏非常规则,当被选中时显示如下 但当触摸(并握住)它们时,所有未评级的星星都是粉红色的,就像这样 为什么会发生这种情况 xml: <RatingBar android:id="@+id/ratingBarSchedulesRatingTour" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="4dp"
<RatingBar
android:id="@+id/ratingBarSchedulesRatingTour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:numStars="5"
android:progressTint="@color/yellow_star"
android:secondaryProgressTint="@color/yellow_star"
android:stepSize="1" />
@color/yellow_star在colors.xml上显示为#F1CD1E创建所需的样式和颜色(按/normal)
#F1CD1E
#F1CD1E
创建所需的样式和颜色(按/normal)
#F1CD1E
#F1CD1E
您可以使用分级栏上的android:progressBackgroundTint
属性来覆盖背景色:
android:progressBackgroundTint="#ABABAB"
您可以使用RatingBar
上的android:progressBackgroundTint
属性覆盖背景色:
android:progressBackgroundTint="#ABABAB"
这不需要使用“progressTint”和“secondaryProgressTint”来帮助清理代码,但它不会更改未选择的开始的背景色。这不需要使用“progressTint”和“secondaryProgressTint”来帮助清理代码,但是它不会改变未选择的星星的背景色。你知道分级栏的默认背景色是什么吗?你知道分级栏的默认背景色是什么吗?