تخطيط Android مع 2 أزرار متباعدة بالتساوي
-
25-09-2019 - |
سؤال
لدي هذا التصميم الذي يعمل بشكل صحيح ، وهو تخطيط نسبي مع عرض نص واثنين من الأزرار متباعدة بالتساوي أسفله.
<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>
لكن تشغيل Lyoutopt ، يقول أن "تصميم Tablerow هذا أو الوالد tablayout ممكن غير مجدي".
هل هناك طريقة للقيام بهذا التصميم ثم بدون الجداول؟
المحلول
تفريغ TableLayout
و TableRow
, ، فقط استخدم أفقيًا LinearLayout
في مكانها. "السحر" في الخاص بك 0dip
العرض و 1
الوزن ، الذي لديك بالفعل.
لا تنتمي إلى StackOverflow