RelativeLayout布局

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/center"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="中间"
android:textSize="32dp"
android:layout_centerInParent="true"/>
<Button
android:gravity="center"
android:layout_alignLeft="@id/center"
android:layout_alignRight="@id/center"
android:layout_above="@id/center"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="上面"
android:textSize="32dp"/>
<Button
android:layout_alignLeft="@id/center"
android:layout_alignRight="@id/center"
android:layout_below="@id/center"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="下面"
android:textSize="32dp"/>
<Button
android:layout_toLeftOf="@id/center"
android:layout_above="@id/center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="左上"
android:textSize="32dp"/>
<Button
android:layout_toLeftOf="@id/center"
android:layout_below="@id/center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="左下"
android:textSize="32dp"/>
<Button
android:layout_toRightOf="@id/center"
android:layout_above="@id/center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="右上"
android:textSize="32dp"/>
<Button
android:layout_toRightOf="@id/center"
android:layout_below="@id/center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="右下"
android:textSize="32dp"/>
<Button
android:layout_alignTop="@id/center"
android:layout_toLeftOf="@+id/center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="左边"
android:textSize="32dp"/>
<Button
android:layout_alignTop="@id/center"
android:layout_toRightOf="@+id/center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="右边"
android:textSize="32dp"/>
</RelativeLayout>