So, I have Android 1.6 activity using TableLayout. One of the lines has a RatingBar. This is my xml:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TableRow> <TextView android:text="name" android:padding="3dip"/> <TextView android:text="@+id/name" android:padding="3dip"/> </TableRow> <TableRow> <TextView android:text="tags" android:padding="3dip"/> <TextView android:id="@+id/tags" android:padding="3dip"/> </TableRow> <TableRow> <TextView android:text="rating" android:layout_width="wrap_content"/> <RatingBar android:id="@+id/rating" style="?android:attr/ratingBarStyleIndicator" android:layout_width="wrap_content" android:rating="4" android:numStars="5"/> </TableRow> <TableRow> <TextView android:text="long string" android:padding="3dip"/> <TextView android:text="this is a very very very long string" android:padding="3dip"/> </TableRow> ... </TableLayout>
I would like to put a text label to the left of the table row, and then have a 5-star rating on the right. But when I do this, the rating value is not displayed correctly, and I have many false empty stars above the indicated maximum of 5:

If I select the โratingโ of the TextView, so the RatingBar is in its own row table, the RatingBar displays as expected, showing 4 out of 5 possible stars:

Does anyone know if it is possible to have a RatingBar on the same line as a TextView? Or do I need to rethink this layout?
edited to add: I think another problem in the table that displays a long text string is causing the problem. Without the โlong lineโ line in the above example, the RatingBar displays correctly on the same line as the โratingโ text.
source share