2
ボタンを画面の両側で一番下に配置する方が良いでしょうか?重要な部分は、RelativeLayoutでのみ使用できるように見えるalignParentBottomと、LinearLayoutおよびRelativeLayoutが1でないTableLayoutのようなサブクラスでのみ使用できるように見えるlayout_gravityです。ボトムアライメントされたボタンのレイアウト
<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 lintは私にこのようなエラーを与えている:
- このTableLayoutのレイアウトやそのRelativeLayoutの親が
- 無用であるこののTableRowのレイアウトやそのTableLayoutの親は無用