RatingBar getting stretched when setting drawable

╄→гoц情女王★ 提交于 2019-12-12 04:41:11

问题


When I am setting progressDrawable to RatingBar its display streched like below image,

xml code is:

<RatingBar
android:id="@+id/rating_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="true"
android:numStars="5"
android:progressDrawable="@drawable/ratingstars"
android:stepSize="1.0" />

ratingstars.xml

<?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/starfullgray"/>
<item
    android:id="@+android:id/secondaryProgress"
    android:drawable="@drawable/starfullgray"/>
<item
    android:id="@+android:id/progress"
    android:drawable="@drawable/starfull"/>
</layer-list>

how to set Ratings Star height to wrap_content by any way ??

来源:https://stackoverflow.com/questions/23519712/ratingbar-getting-stretched-when-setting-drawable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!