的大小我想为我的Android应用程序制作自定义RatingBar,其中我可以更改RatingBar的默认大小和颜色。为此我写了样式CustomRatingBar这样的:无法更改自定义RatingBar
<style name="CustomRatingBar" parent="@android:style/Widget.RatingBar">
<item name="android:progressDrawable">@drawable/custom_ratingbar</item>
<item name="android:minHeight">25dp</item>
<item name="android:maxHeight">25dp</item>
</style>
绘制对象文件是:custom_ratingbar.xml,custom_ratingbar_empty, custom_ratingbar_filled
在我的XML,的RatingBar看起来象下面这样:
<RatingBar
android:id="@+id/RatingBar"
style="@style/CustomRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:isIndicator="true"
android:numStars="5" />
如何更改评级栏的星形大小而不缩小?
使用:'style =“?android:attr/ratingBarStyleSmall”' –
你使用的是什么图标大小?使用更大的图标,如48x48或50x50并保存在xxhdpi文件夹中。 – Mubarak