ShapeDrawable als progressDrawable für RatingBar in Android?
Es scheint, dass ich ShapeDrawable für Ratingbar nicht als progressDrawable festlegen kann. Ich habe Folgendes versucht, bin aber gescheitert:
<RatingBar
android:id="@+id/ratingbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:numStars="5"
android:stepSize="1.0"
android:rating="3.0"
style="@style/myRatingBar"
/>
myRatingbar-Stil:
<style name="myRatingBar" parent="@android:style/Widget.RatingBar">
<item name="android:progressDrawable">@drawable/ratingbar_full</item>
<item name="android:indeterminateDrawable">@drawable/ratingbar_full</item>
<item name="android:minHeight">48dip</item>
<item name="android:maxHeight">48dip</item>
<item name="android:scaleType">center</item>
</style>
ratingbar_full.xml:
<shape
android:shape="ring"
android:innerRadius="10dip"
android:thickness="1dip">
<solid android:color="@color/red" />
<size
android:width="48dip"
android:height="48dip"
/>
</shape>
Auf dem Bildschirm wird nichts angezeigt.
BEARBEITEN: Verwenden Sie .png anstelle von Shape Works für diese Zeile:
@ drawable / ratingbar_full