Drawable不适合android自定义分级栏

Drawable不适合android自定义分级栏,android,ratingbar,Android,Ratingbar,我有一个自定义评级栏的问题。我已遵照 创建我的自定义评级栏和机械工程,但我有一个小故障在我的酒吧结束:[这里是一张图片] 背景和progressDrawable似乎不合适。我真的不知道问题出在哪里。 我以为我有一个答案的开头,但因为我没有使用二级可进行绘图,所以对我没有帮助 编辑: 这里是我使用的XML文件。不以编程方式执行任何操作: values/style.xml <style name="UserRatingBar" parent="@android:style/Widget.Ra

我有一个自定义评级栏的问题。我已遵照

创建我的自定义评级栏和机械工程,但我有一个小故障在我的酒吧结束:[这里是一张图片]

背景和progressDrawable似乎不合适。我真的不知道问题出在哪里。 我以为我有一个答案的开头,但因为我没有使用二级可进行绘图,所以对我没有帮助

编辑:

这里是我使用的XML文件。不以编程方式执行任何操作:

values/style.xml

<style name="UserRatingBar" parent="@android:style/Widget.RatingBar">
    <item name="android:progressDrawable">@drawable/user_rating_stars</item>
</style>

@可拉拔/用户评级
drawable/user_rating_stars.xml:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background"
        android:drawable="@drawable/user_rating_bar_empty"/>
    <item android:id="@android:id/progress"
        android:drawable="@drawable/user_rating_bar_full"/>
</layer-list>

可提取/用户\额定值\栏\空:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/star_normal" android:state_pressed="true" android:state_window_focused="true"/>
    <item android:drawable="@drawable/star_normal" android:state_focused="true" android:state_window_focused="true"/>
    <item android:drawable="@drawable/star_normal" android:state_selected="true" android:state_window_focused="true"/>
    <item android:drawable="@drawable/star_normal"/>
</selector>

可抽出/用户\额定值\条形图\满:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/star_active" android:state_pressed="true" android:state_window_focused="true"/>
    <item android:drawable="@drawable/star_active" android:state_focused="true" android:state_window_focused="true"/>
    <item android:drawable="@drawable/star_active" android:state_selected="true" android:state_window_focused="true"/>
    <item android:drawable="@drawable/star_active"/>
</selector>


提前感谢您的帮助。

我也建立了一个自定义评级栏。你可以在我的代码中找到一个峰值,看看你是否能发现你的问题。我建议你更新你的问题并添加一些代码,这样我们就可以检查发生了什么。@DroidLearner是的,这是可能的。我刚刚向github提交了一个新版本。使用属性
app:halfStars
来定义是否要使用半星。@PedroOliveira谢谢,效果很好!!而且我不能从5到5把星星变成00@DroidLearner是的,你说得对。这是我为另一个项目所做的改变。已经修好了