2
有没有更好的方式来做到这一点,其中按钮在屏幕的任何一边都是底部对齐的?重要的部分是似乎仅在RelativeLayout中可用的alignParentBottom和仅在LinearLayout及其子类(如TableLayout)中可用的layout_gravity,其中RelativeLayout不是其中一个。布置底部对齐的按钮
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="1">
<TableRow>
<Button
android:id="@+id/list_delete"
android:text="@string/list_delete"
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/list_save"
android:text="@string/list_add"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</TableRow>
</TableLayout>
</RelativeLayout>
的Android皮棉给我的错误是这样的:
- 这TableLayout布局或其RelativeLayout的父母也没用
- 此的TableRow布局或其TableLayout父母也没用