我希望减少评级栏的大小,但无法这样做。想要在评级栏上申请,他们的评级栏尺寸没有变化。
请帮忙
这是style.xml
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppTheme" parent="android:Theme.Light" />
<style name="ratingBar" parent="@android:style/Widget.RatingBar">
<item name="android:maxHeight">10dip</item>
<item name ="android:maxWidth">10dip</item>
</style>
</resources>
main.xml中
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RatingBar
android:id="@+id/ratingBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginBottom="58dp"
style="@style/ratingBar" />
</RelativeLayout>
答案 0 :(得分:0)
您需要为星星设置drawable
<style name="RatingBar" parent="@android:style/Widget.RatingBar">
<item name="android:progressDrawable">@drawable/ratingbar_stars</item>
<item name="android:minHeight">32dp</item>
<item name="android:maxHeight">32dp</item>
</style>
<style name="RatingBar.Small" parent="@android:style/Widget.RatingBar">
<item name="android:progressDrawable">@drawable/ratingbar_stars_small</item>
<item name="android:minHeight">22dp</item>
<item name="android:maxHeight">22dp</item>
</style>