RatingBar的stepSize介于0和0.5之间?

时间:2017-02-08 10:01:33

标签: android android-layout ratingbar

我试图获得一个小的评级栏来显示3.2 / 5或4.7 / 5等值,而不是四舍五入到最接近的0.5。我已经尝试在java和xml中设置stepSize但每次都会进行舍入。

                <RatingBar
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/ratingBar"
                    style="@style/Widget.AppCompat.RatingBar.Small"
                    android:theme="@style/RatingBar"
                    android:isIndicator="true"
                    android:numStars="5"
                    android:stepSize="0.10"/>

我没有发现任何可以说0.5是最大步长的事实 - 实际上看看ratingBar的代码本身似乎很清楚0.1是可以接受的。主题“@ style / RatingBar”仅描述了星星的背景和前景色。

0 个答案:

没有答案