layout_alignLeft是表示这个控件和所制定的控件的左边界对齐;layout_toLeftOf是表示这个控件在所指定控件的左边,例如:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<Button
android:id="@+id/bt_zhongxin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="○" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/bt_zhongxin"
android:layout_alignLeft="@id/bt_zhongxin"
android:text="∧" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/bt_zhongxin"
android:layout_below="@id/bt_zhongxin"
android:text="∨" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/bt_zhongxin"
android:layout_toLeftOf="@id/bt_zhongxin"
android:text="〈" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/bt_zhongxin"
android:layout_toRightOf="@id/bt_zhongxin"
android:text="〉" />
</RelativeLayout>
界面效果是: