Color difference of Android ratingbar on different devices
•
Android
I have a ratingbar
<android.support.v7.widget.AppCompatratingBar
android:id="@+id/rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="false"
android:numStars="5"
android:rating="0.0"
android:stepSize="1.0"
android:theme="@style/ratingBar"/>
And style:
<style name="ratingBar" parent="Theme.AppCompat">
<item name="colorControlNormal">@color/old_gray</item>
<item name="colorControlActivated">@color/yellow</item>
</style>
The problem is that this style is ignored for some reason:
Nexus 5x API 24:
Samsung S4 API 21:
My activity is an extension of fragmentactivity. Maybe the problem is here? How?
resolvent:
Starting with API 21, you just need to make changes from XML
android:progressTint="@android:color/holo_red_dark"
android:progressBackgroundTint="@android:color/holo_red_dark"
android:secondaryProgressTint="@android:color/holo_red_dark"
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码