Android RatingBar属性代表什么?
我为这个问题道歉,但我在理解RatingBar属性时遇到了问题 基本上,我正在尝试创建一个总共有7颗星的评级条,它每次“跳跃”0.5颗星 以下是我目前拥有的。但它似乎向我展示了1/4星和3/4星,但从来没有一个合适的半星Android RatingBar属性代表什么?,android,android-widget,Android,Android Widget,我为这个问题道歉,但我在理解RatingBar属性时遇到了问题 基本上,我正在尝试创建一个总共有7颗星的评级条,它每次“跳跃”0.5颗星 以下是我目前拥有的。但它似乎向我展示了1/4星和3/4星,但从来没有一个合适的半星 <RatingBar android:id="@+id/rating" android:layout_width="wrap_content" android:layout_height="wrap_content" android:rat
<RatingBar
android:id="@+id/rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rating="3.5"
android:numStars="7"
android:stepSize="0.5" />
评级和numStars之间有什么区别?我只需要一个简单的面额7。引用文件:
Attribute Name Related Method Description
android:isIndicator setIsIndicator(boolean) Whether this rating bar is an indicator (and non-changeable by the user).
android:numStars The number of stars (or rating items) to show.
android:rating The rating to set by default.
android:stepSize The step size of the rating.
很明显,我当前的属性值是正确的。我之所以能看到1/4或3/4颗星,是因为我的屏幕不够宽。当我换成景观时,效果很好 1/7=0.1428您的去核器
是的,我读过,但是numStars和rating有什么区别?或者我如何获得我的3.5/7星级?我的东西没有正确地显示出来。图特