0
votes

I would like to create a TableRow view that contains three TextViews. Two of those TextViews should be placed above each other on the left side of the TableRow. This works fine, however I'm not able to place the third TextView on the far right side of the TableRow.

The code is as follows, but doesn't do what I want. What am I missing? Code is below.

    <TableLayout
    android:id="@+id/hoblerValues"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <TableRow
        android:id="@+id/table_row_prototype"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <TextView
                android:id="@+id/text_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:text="19:13" />

            <TextView
                android:id="@+id/text_date"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/text_time"
                android:text="11.06.2014" />

            <TextView
                android:id="@+id/text_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:text="248.00"
                android:textAppearance="?android:attr/textAppearanceLarge" />

        </RelativeLayout>
    </TableRow>

</TableLayout>
1

1 Answers

0
votes

Your TextViews, text_time and text_date should both have

android:layout_alignParentLeft="true"

In the attributes for text_date

android:layout_below="@+id/text_time"

should be

android:layout_below="@id/text_time"

There's no need for

android:orientation="horizontal"

in the RelativeLayout.