在我的屏幕布局中包含一个中央按钮,我想将该按钮与屏幕底部对齐。我尝试了一些代码,但它变得很棒......
我的xml代码如下
<?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" >
<Button
android:id="@+id/btnButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 1"/>
<RelativeLayout
android:id="@+id/belowLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
>
<Button
android:id="@+id/btnButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="Left"/>
<Button
android:id="@+id/btnButton3"
android:layout_width="75px"
android:layout_height="50px"
android:layout_centerHorizontal="true"
android:text="..."/>
<Button
android:id="@+id/btnButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="Right"/>
</RelativeLayout>
</RelativeLayout>
截屏
谢谢