[英]Android rating bar only show one star
我使用的是 Android 默认评级栏,但在某些设备(三星)上,它只显示您在照片中看到的一颗星。 我不知道是什么导致了这个问题以及如何解决它。 感谢你的帮助。
<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" />
找到了! 我能够重现启用后,运行Android 9三星设备在这个问题上Settings -> Advanced features -> Video enhancer
,并通过对所有RatingBars禁用硬件加速所描述的固定它在这里:
ratingBar.setLayerType(View.LAYER_TYPE_SOFTWARE, null)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.