RatingBar 主题适用于 Marshmallow 但不适用于 Lollipop

RatingBar Theme working in Marshmallow but not in Lollipop

我正在尝试使用以下代码设置我的 RatingBar 的样式:

<style name="RatingBarfeed" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorControlNormal">@color/white</item>
    <item name="colorControlActivated">@color/duskYellow</item>
</style>

在 layout.xml 中,我使用以下代码:

<android.support.v7.widget.AppCompatRatingBar
        android:theme="@style/RatingBarfeed"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        style="?android:attr/ratingBarStyleSmall"
        android:id="@+id/ratingBar"
        android:paddingBottom="0.45dp"
        app:layout_constraintTop_toTopOf="@+id/rating"
        app:layout_constraintLeft_toRightOf="@+id/rating"
        app:layout_constraintBottom_toBottomOf="@+id/rating"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        android:background="@color/orange"
        android:rating="3.5"
        android:stepSize="0.5"/>

它在 Marshmallow 中运行良好(查看屏幕截图)

但在 Lollipop 主题中无法使用(查看屏幕截图)

请帮忙...!!!!

经过一番努力,我得到了答案: 它应该是 style="@style/RatingBarfeed" 而不是 android:theme+"@style/RatingBarfeed"

用于造型星形填充、空白和局部颜色

android:progressTint="#F9BB28"
android:progressBackgroundTint="@color/white"
android:secondaryProgressTint="@color/white"

最终代码应该是这样的

 <android.support.v7.widget.AppCompatRatingBar
        android:layout_width="wrap_content"
        android:layout_height="18dp"
        style="@style/RatingBarfeed"
        android:id="@+id/ratingBar"
        android:gravity="center"
        android:progressTint="#F9BB28"
        android:progressBackgroundTint="@color/white"
        android:secondaryProgressTint="@color/white"
        app:layout_constraintTop_toTopOf="@+id/rating"
        app:layout_constraintLeft_toRightOf="@+id/rating"
        app:layout_constraintBottom_toBottomOf="@+id/rating"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        android:background="@color/orange"
        android:rating="3.5"
        android:stepSize="0.1"/>

样式应为:

<style name="RatingBarfeed" parent="android:style/Widget.Material.RatingBar.Small">
    <item name="colorControlNormal">@color/white</item>
    <item name="colorControlActivated">@color/duskYellow</item>
</style>