如果我调整layout_width或layout_height,星星会不断被切断-即使当我变小或变大时,星星也会成为问题。
我尝试调整或使用:style =“?android:attr / ratingBarStyleSmall”
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RatingBar
android:id="@+id/MyRating"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="match_parent"
android:layout_height="33.5dp"
android:layout_below="@id/getRating"
android:isIndicator="true"
android:numStars="5"
android:stepSize="0.1"
android:minHeight="18dp"
android:maxHeight="18dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="30dp"
android:minWidth="25px"
android:minHeight="25px">
<RatingBar
android:id="@+id/rating_bar"
android:layout_width="wrap_content"
android:layout_height="71.0dp"
android:isIndicator="true"
android:max="5"
style="@style/Widget.AppCompat.RatingBar.Indicator"
android:numStars="5"
android:scaleX="0.5"
android:scaleY="0.5"
tools:rating="3"
android:layout_marginBottom="12.5dp" />
</LinearLayout>
</RelativeLayout>