Omr*_*mri 38
你可以在相对布局中做这样的事情
<LinearLayout android:id="@+id/footer" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:layout_alignParentBottom="true" style="@android:style/ButtonBar">
<Button android:id="@+id/saveButton" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1"
android:text="@string/menu_done" />
<Button android:id="@+id/cancelButton" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1"
android:text="@string/menu_cancel" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
小智 7
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:id="@+id/buttonBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
style="@android:style/ButtonBar"
android:gravity="center"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:text="Button Bar"/>
</LinearLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
从以下链接 底栏获取它