RatingBar主题在Marshmallow工作但不在Lollipop工作

Rah*_*rma 1 android ratingbar android-styles

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

<style name="RatingBarfeed" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorControlNormal">@color/white</item>
    <item name="colorControlActivated">@color/duskYellow</item>
</style>
Run Code Online (Sandbox Code Playgroud)

在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"/>
Run Code Online (Sandbox Code Playgroud)

它在Marshmallow工作正常(查看截图) 在此输入图像描述

但在Lollipop主题不起作用(查看截图) 在此输入图像描述

请帮忙...!!!!

Rah*_*rma 9

经过多次努力,我得到了答案:它应该是style="@style/RatingBarfeed"代替android:theme+"@style/RatingBarfeed"

用于样式星填充,空和部分颜色

android:progressTint="#F9BB28"
android:progressBackgroundTint="@color/white"
android:secondaryProgressTint="@color/white"
Run Code Online (Sandbox Code Playgroud)

最终的代码应该是这样的

 <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"/>
Run Code Online (Sandbox Code Playgroud)

风格应该是:

<style name="RatingBarfeed" parent="android:style/Widget.Material.RatingBar.Small">
    <item name="colorControlNormal">@color/white</item>
    <item name="colorControlActivated">@color/duskYellow</item>
</style>
Run Code Online (Sandbox Code Playgroud)