I'm new to Android development, so forgive me if this is a noob question! I am trying to display a table containing 2 columns. The 2nd column should be right aligned, but can be a fixed width. The first column should stretch to fill any remaining space. I have a very simple table layout, but it pushes the 2nd column's text off the edge of the screen so you can't read it.
Here is the XML for the layout:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tbl_my_tanks"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="0">
<TableRow android:padding="3dip">
<TextView
android:id="@+id/col_tank_name"
android:text="@string/tanks_tank_name" />
<TextView
android:id="@+id/col_stock_level"
android:gravity="right"
android:text="@string/tanks_stock_level" />
</TableRow>
</TableLayout>
...and this is what it looks like when I run it:
How can I get it to align right correctly? (I tried using android:layout_gravity="right", but that made no difference).