<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
//相对布局 可以不用嵌套就可以实现复杂布局,个人感觉最新的约束布局是这个的升级版
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/button6"
//代码id是唯一的,用于被其他方法等的调用
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
//将该控件和父控件的地步对齐
android:layout_marginBottom="0dp"
android:text="一" />
//该按钮的显示信息为 一
<Button
android:id="@+id/button7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
//该控件的右边与父控件的右边对齐
android:text="二" />
<Button
android:id="@+id/button8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
//该控件被置于父控件的水平与垂直方向的中央
android:text="三" />
<Button
android:id="@+id/button9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/button8"
该控件将被放在引用控件的后方
android:layout_centerVertical="true"
//该控件被置于垂直方向的中央
android:text="四" />
</RelativeLayout>