简体   繁体   English

Android 评分栏只显示一颗星

[英]Android rating bar only show one star

I am using Android default rating bar, but on some devices (Samsung), it only shows one star as you see in the photos.我使用的是 Android 默认评级栏,但在某些设备(三星)上,它只显示您在照片中看到的一颗星。 I don't know what is causing this issue and how to resolve it.我不知道是什么导致了这个问题以及如何解决它。 Appreciate your help.感谢你的帮助。

<RatingBar
        android:id="@+id/ratingBar"
        android:layout_below="@+id/questionText"
        android:layout_marginTop="10dp"
        android:numStars="5"
        android:stepSize="1"
        android:max="5"
        android:theme="@style/RatingBar"
        android:layout_centerHorizontal="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

在此处输入图片说明

Found it!找到了! I was able to reproduce this issue on a Samsung device running Android 9 after enabling Settings -> Advanced features -> Video enhancer , and fixed it by disabling hardware acceleration on all RatingBars as described here :我能够重现启用后,运行Android 9三星设备在这个问题上Settings -> Advanced features -> Video enhancer ,并通过对所有RatingBars禁用硬件加速所描述的固定它在这里

ratingBar.setLayerType(View.LAYER_TYPE_SOFTWARE, null)

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

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