[英]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.