我是使用 XML 进行设计的初学者:D 这是我的评分栏和朋友的 XML:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="2" >
<TextView
android:id="@+id/txtTitle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:textColor="#336699"
android:textSize="18dp"
android:textStyle="bold" />
<RatingBar
android:id="@+id/rtbHighScore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:numStars="5"
android:max="100"
android:rating="0.0"
android:stepSize="0.0"
style="?android:attr/ratingBarStyleSmall"
android:layout_weight="1" />
<ImageView
android:id="@+id/imgRow"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="right"
android:layout_marginBottom="5dp"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:src="@drawable/rightarrow" />
</LinearLayout>
是android:numStars5,但这是我得到的:

我读到layout_width必须是wrap_content这样,所以评分栏星星会跟随我android:numStars,这就是我将其更改为时得到的结果wrap_content:

我想在我的 textview 右侧(或我的右箭头图像的左侧)创建 5 星评分栏 谢谢:D