1, first in the layout of reference star rating bar:
<ratingbar
Android:id= "@+id/room_ratingbar"
style= "@style/roomratingbar"
Android:layout_width= "Wrap_content"
android:layout_height= "Fill_parent"/>
2. Define the style used in the previous step:
<style name= "Roomratingbar" parent= "@android: Style/widget.ratingbar" >
<item name= "android:progressdrawable" > @drawable/room_rating_bar</item>
<item name= "Android:minheight" >16dip</item>
<item name= "Android:maxheight" >16dip</item>
</style>
3. Define the drawable used in the second step:
<?xml version= "1.0" encoding= "Utf-8"?>
<!--
This is the rating bar drawable, which is used to show a for the class Num.
-
<layer-list xmlns:android= "Http://schemas.android.com/apk/res/android" >
<!--not selected-
<item android:id= "@+android:id/background"
android:drawable= "@drawable/room_unselect" ></item>
<!--half-star--
<item android:id= "@+android:id/secondaryprogress"
android:drawable= "@drawable/room_unselect" ></item>
<!--whole star--
<item android:id= "@+android:id/progress"
android:drawable= "@drawable/room_select" ></item>
</layer-list>
Change the style of the star rating bar Ratingbar