我制作了自己的评分栏。有 4 种尺寸的花卉图像(xdpi、hdpi 等),从 24pxx24px 到 64x64px。
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+android:id/background"
android:drawable="@drawable/ic_rating_flowers_empty" />
<item android:id="@+android:id/secondaryProgress"
android:drawable="@drawable/ic_rating_flowers_empty" />
<item android:id="@+android:id/progress"
android:drawable="@drawable/ic_rating_flowers" />
</layer-list>
可绘制对象中的 rating_flowers.xml
<style name="flowersRating" parent="@android:style/Widget.RatingBar">
<item name="android:progressDrawable">@drawable/rating_flowers</item>
<item name="android:minHeight">24dip</item>
<item name="android:maxHeight">64dip</item>
</style>
在样式.xml
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dip" >
<TextView
android:text="@string/mood_headache" />
<RatingBar
android:id="@+id/moodHeadacheRating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="3"
android:stepSize="1.0"
android:rating="0"
style="@style/flowersRating" />
</TableRow>
和活动
而我所看到的
和来自drawable-ldpi的图像