アプリケーションで 4 列の TableLayout を使用しています。評価バーを連続して挿入するとlayout_span=3
、星が期待どおりに機能しません。
例として をつけましたが、6つ星の2/3numStars=5
を示しています。また、3 番目の星をクリックすると 3.25 の星が選択され、4 番目を選択すると 4.5 が強調表示されます... スケーリングが正しく機能していません。
layout_height を wrap_content に変更してみましたが、結果は同じです。layout_span を削除した場合にのみ正常に動作しますが、その場合、他の行の列に歪みがあります。
何が問題なのか、誰でも助けてもらえますか? これが通常の動作である場合、layout_span で適切な評価バーを取得するにはどうすればよいですか?
<TableRow
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" >
<TextView
android:id="@+id/rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rating" />
<RatingBar
android:id="@+id/add_rating"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_span="3"
android:numStars="5"
android:stepSize="1"
android:rating="4" />
</TableRow>
// NORMAL ROW
<TableRow
android:id="@+id/tr12"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" >
<TextView
android:id="@+id/lab_datepurchased"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/datepurchased" />
<EditText
android:id="@+id/add_datepurchased"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/dateinput" />
<TextView
android:id="@+id/lab_shelfno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/shelfno" />
<EditText
android:id="@+id/add_shelfno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/definputtext2" />
</TableRow>