How can I set the star color of the ratingbar?

后端 未结 10 1666
夕颜
夕颜 2021-02-12 19:54

How can I set the star color of the ratingbar? I want yellow stars.

10条回答
  •  执念已碎
    2021-02-12 20:33

    You do need 3 star images (star_filled_show.png, star_half_show.png and star_empty_show.png) and one xml, that's all.

    Put these 3 images into res/drawable.

    Put there the following ratingbarstars.xml:

    
    
           
    
    
    
    
    
    

    Tell your ratingbar definition to use this drawable

    
    

提交回复
热议问题