Ratingbar 的最后一颗星正在被裁掉
Ratingbar's last star is getting cropped
我用 RecyclerView 显示每个用户的评分。但是我在评级栏中的最后一颗星被裁掉了,尽管我有足够的 space。此处显示示例图片
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/review_user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Shahrear Bin Amin rated it"/>
<RatingBar
android:paddingLeft="5dp"
android:id="@+id/each_user_rating"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:isIndicator="true"
android:numStars="5"/>
</LinearLayout>
在 RatingBar
上使用 marginStart
而不是使用 paddingLeft
<RatingBar
android:marginStart="5dp"
android:id="@+id/each_user_rating"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:isIndicator="true"
android:numStars="5"/>
我用 RecyclerView 显示每个用户的评分。但是我在评级栏中的最后一颗星被裁掉了,尽管我有足够的 space。此处显示示例图片
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/review_user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Shahrear Bin Amin rated it"/>
<RatingBar
android:paddingLeft="5dp"
android:id="@+id/each_user_rating"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:isIndicator="true"
android:numStars="5"/>
</LinearLayout>
在 RatingBar
marginStart
而不是使用 paddingLeft
<RatingBar
android:marginStart="5dp"
android:id="@+id/each_user_rating"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:isIndicator="true"
android:numStars="5"/>