简体   繁体   中英

RatingBar - When touch the RatingBar the stars get all filled up

Im working with a native RatingBar and i am having only one problem.

I have 5 stars, starting all of them empty. 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.

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

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

我现在手指离开屏幕

Add below line inside <RatingBar>

android:progressBackgroundTint="@color/white"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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