更改或删除RatingBar焦点颜色

问题描述 投票:0回答:1

我有RatingBar和样式。我想在RatingBar上删除焦点颜色。

我的空RatingBar的颜色:enter image description here我的RatingBar的聚焦颜色:enter image description here我要删除聚焦色:enter image description here

主题:

 <style name="CustomRatingBar" parent="Theme.AppCompat">
    <item name="colorControlNormal">@color/lightTransparentBlack</item>
    <item name="colorControlActivated">@color/yellow</item>
</style>

布局:

<RatingBar
  android:id="@+id/ratingBar"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_gravity="center"
  android:theme="@style/CustomRatingBar"
  android:layout_marginTop="20dp"
  android:numStars="5"
  android:stepSize="1" />
android focus ratingbar
1个回答
1
投票

在API 21及更高版本上,您可以使用以下方式更改填充的星星的颜色

 android:progressTint="@color/color"

和笔触的颜色带有

 android:progressBackgroundTint="@color/color"
© www.soinside.com 2019 - 2024. All rights reserved.