How to make RatingBar to show five stars

前端 未结 18 475
栀梦
栀梦 2020-12-04 18:58

I am following the standard example of how to add a RatingBar. To control the number of stars I tried to use android:numStars=\"5\". The problem is

18条回答
  •  有刺的猬
    2020-12-04 19:23

    You should just use numStars="5" in your XML, and set android:layout_width="wrap_content".
    Then, you can play around with styles and other stuff, but the "wrap_content" in layout_width is what does the trick.

提交回复
热议问题