[英]RatingBar - When touch the RatingBar the stars get all filled up
Im working with a native RatingBar and i am having only one problem.我正在使用本地 RatingBar,我只有一个问题。
I have 5 stars, starting all of them empty.我有 5 颗星,一开始都是空的。 When i touch on star (or swipe my finger across the rating bar) the 5 stars get selected and the real rate shows up after i separate my finger of the screen.当我触摸星星(或在评级栏上滑动手指)时,5 颗星被选中,当我将手指从屏幕上移开后,实际汇率就会显示出来。
Why is this happening?为什么会这样?
<RatingBar
android:id="@+id/ratingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
android:stepSize="1"
android:rating="5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/subtitle"/>
Image 1: Here i am with my finger on the screen in the star number 3 Image 2: An here i am now with my finger off the screen图片 1:我的手指放在屏幕上,出现在 3 号星中 图片 2:我现在的手指离开屏幕
Add below line inside <RatingBar>
在<RatingBar>
中添加以下行
android:progressBackgroundTint="@color/white"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.