我终于找到了如何更改ratingBar的图像,但我无法弄清楚如何更改大小。我有这个android ratingbar size
<resources>
<style name="foodRatingBarSmall" parent="@android:style/Widget.RatingBar.Small">
<item name="android:progressDrawable">@drawable/rating_bar_used</item>
<item name="android:minHeight">10dip</item>
<item name="android:maxHeight">10dip</item>
</style>
</resources>
但每当我在minHeight
和maxHeight
改变它的大小保持不变。
我的布局XML:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:onClick="showRecipeOnClick" android:clickable="true" style="@style/row">
<TableRow
android:id="@+id/tableRow1" android:layout_gravity="center" android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="center_vertical">
<TextView android:id="@+id/customName"
android:textSize="25px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textColor="@color/black"
android:layout_weight="5">
</TextView>
<RatingBar android:id="@+id/mainRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
android:stepSize="0.5"
android:isIndicator="true"
android:layout_gravity="center_vertical"
style="@style/foodRatingBarSmall"></RatingBar>
</TableRow>
<View android:layout_width="fill_parent"
android:layout_height="2dip"
android:background="@color/black"/>
</TableLayout>
我在做什么错?
谢谢您的帮助
邮政布局XML。 – 2011-03-18 16:50:44