How to make a smaller RatingBar?

前端 未结 18 1509
情话喂你
情话喂你 2020-11-27 09:29

I\'ve added a RatingBar in a layout:



        
18条回答
  •  鱼传尺愫
    2020-11-27 09:35

    The default RatingBar widget is sorta' lame.

    The source makes reference to style "?android:attr/ratingBarStyleIndicator" in addition to the "?android:attr/ratingBarStyleSmall" that you're already familiar with. ratingBarStyleIndicator is slightly smaller but it's still pretty ugly and the comments note that these styles "don't support interaction".

    You're probably better-off rolling your own. There's a decent-looking guide at http://kozyr.zydako.net/2010/05/23/pretty-ratingbar/ showing how to do this. (I haven't done it myself yet, but will be attempting in a day or so.)

    Good luck!

    p.s. Sorry, was going to post a link to the source for you to poke around in but I'm a new user and can't post more than 1 URL. If you dig your way through the source tree, it's located at frameworks/base/core/java/android/widget/RatingBar.java

提交回复
热议问题