これは半角でも表示されません!もちろん、私は他のすべての質問を準備している、彼らは試していない魔法を含んでいない。Android RatingBar ratingBarStyleSmallは完全な/塗りつぶされた星のみを表示します
私はスタイルをratingBarStyle
に変更しようとしましたが、半分の星がありますが、もちろん、通常のサイズのRatingBarは私の要件を満たしていません。
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RatingBar
android:id="@+id/ratingBar2"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="true"
android:backgroundTint="@color/colorAccent"
android:progressTint="@color/colorAccent"
android:secondaryProgressTint="@color/colorAccent"
android:numStars="5"
android:rating="3.3"
android:stepSize="0.1"/>
</LinearLayout>
私のJavaコード:
ratingBar.setStepSize(0.1f);
ratingBar.setRating(3.5f);
結果、私が見ている:私はAndroidのサポートバージョン23.4.0を使用してい
。 私のcompileSdkVersion
とtargetSdkVersion
はともに23です。 Android 5.0デバイスでテストしています。
ステップサイズ0.5を使用してチェックしてください。 – Vickyexpert