您的位置:首页 > 移动开发 > Android开发

Android简单布局-------相对布局

2014-05-23 22:49 302 查看
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context=".MainActivity" >

<ImageButton

android:id="@+id/img1"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_centerInParent="true"

android:src="@drawable/hb" />

<ImageButton

android:id="@+id/img2"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_above="@id/img1"

android:layout_toLeftOf="@id/img1"

android:src="@drawable/cm" />

<ImageButton

android:id="@+id/img3"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_above="@id/img1"

android:layout_toRightOf="@id/img1"

android:src="@drawable/fq" />

<ImageButton

android:id="@+id/img4"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/img1"

android:layout_toLeftOf="@id/img1"

android:src="@drawable/qj" />

<ImageButton

android:id="@+id/img5"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/img1"

android:layout_toRightOf="@id/img1"

android:src="@drawable/xj" />

</RelativeLayout>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: