Frage

Ich habe dieses Layout, das mit einer Textansicht und zwei Tasten im Abstand gleichmäßig darunter.

richtig, ein relatives Layout funktioniert
<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>

Aber layoutopt läuft es sagt, dass „dieses TableRow Layout oder seine Eltern Tablelayout nutzlos ist möglich“.

Gibt es eine Möglichkeit, dieses Layout zu tun, dann ohne die Tabellen?

War es hilfreich?

Lösung

Dump die TableLayout und TableRow, und nur eine horizontale LinearLayout an ihrer Stelle verwendet werden. Die „Magie“ ist in Ihrer 0dip Breite und 1 Gewicht, die Sie bereits haben.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top