Android layout with 2 evenly spaced Buttons

Posted by Rpond on Stack Overflow See other posts from Stack Overflow or by Rpond
Published on 2010-04-08T23:36:57Z Indexed on 2010/04/08 23:43 UTC
Read the original article Hit count: 906

I have this layout that works correctly, a relative layout with a text view and two buttons spaced evenly below it.

<RelativeLayout android:id="@+id/entrypopup"
            android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:padding="5px"
    android:visibility="gone"
    android:layout_below="@+id/ad"
    android:background="#80000000">
    <TextView android:id="@+id/title" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:text="Entry Popup..."
        android:textColor="#ffffffff"
        android:textSize="20sp" />
    <TableLayout android:id="@+id/TableLayout01"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        android:layout_below="@id/title">
        <TableRow android:layout_weight="1">
            <Button android:id="@+id/buttonVisit" android:text="View"
                android:layout_height="fill_parent"
                android:layout_width="0dip"
                android:layout_weight="1"/>
            <Button android:id="@+id/buttonCancel" android:text="Cancel"
                android:layout_width="0dip"
                android:layout_weight="1" 
                android:layout_height="fill_parent"/>
        </TableRow>
    </TableLayout>
</RelativeLayout>

But running layoutopt it says that "this TableRow layout or its TableLayout parent is possible useless".

Is there a way to do this layout then without the tables?

© Stack Overflow or respective owner

Related posts about android

Related posts about android-layout