2つの等間隔のボタンでAndroidのレイアウト
-
25-09-2019 - |
質問
私は正常に動作するこのレイアウトを持つ、テキストビューと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の親が役に立たない可能である」と述べています。
テーブルずに、このレイアウトを行うための方法はありますか?
解決
TableLayout
とTableRow
をダンプし、ちょうどその場所に水平LinearLayout
を使用しています。 「魔法」は、あなたが既に持っているあなたの0dip
幅と1
重量、である。
所属していません StackOverflow