繁体   English   中英

RatingBar - 当触摸 RatingBar 时,星星会全部填满

[英]RatingBar - When touch the RatingBar the stars get all filled up

我正在使用本地 RatingBar,我只有一个问题。

我有 5 颗星,一开始都是空的。 当我触摸星星(或在评级栏上滑动手指)时,5 颗星被选中,当我将手指从屏幕上移开后,实际汇率就会显示出来。

为什么会这样?

<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"/>

图片 1:我的手指放在屏幕上,出现在 3 号星中 图片 2:我现在的手指离开屏幕

在这里,我的手指在 3 号星的屏幕上

我现在手指离开屏幕

<RatingBar>中添加以下行

android:progressBackgroundTint="@color/white"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM