質問

私は正常に動作するこのレイアウトを持つ、テキストビューと2つのボタンとの相対的なレイアウトが均等に下に間隔をあけます。

<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>

しかし、実行しているlayoutoptそれは「こののTableRowのレイアウトやそのTableLayoutの親が役に立たない可能である」と述べています。

テーブルずに、このレイアウトを行うための方法はありますか?

役に立ちましたか?

解決

TableLayoutTableRowをダンプし、ちょうどその場所に水平LinearLayoutを使用しています。 「魔法」は、あなたが既に持っているあなたの0dip幅と1重量、である。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top