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>
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>
相关文章推荐
- Android 相对布局 简单编程
- Android 相对布局 简单编程
- Android 简单 相对布局的实现;
- android 布局之RelativeLayout(相对布局)
- android 相对布局属性
- Android 相对布局
- Android Toast带图标水平布局的简单实现
- [转]Android布局之RelativeLayout(相对布局)
- android布局之一:简单入门
- android 相对布局心得
- android 相对布局
- Android UI Design 04 : 相对布局 Relative Layouts
- Android 1.5和Android 2.1在相对布局(RelativeLayout)上的区别
- 13、从头学Android之RelativeLayout相对布局
- Android_RelativeLayout(相对布局)
- Android布局之RelativeLayout(相对布局)
- android 相对布局 RelativeLayout 属性
- android 相对布局
- android-简单布局
- Android学习系列(5)--App布局初探之简单模型