【android】相对布局
来源:互联网 发布:php资源共享 编辑:程序博客网 时间:2024/05/22 08:35
1.概述
指定控件间的相对布局。
2.标签
layout_alignParentBottom:父容器的右边。
layout_alignParentEnd:父容器的下边。
layout_above:在别人的上边
layout_alignLeft:与别人左对齐
layout_toLeftOf:在别人的左边
layout_alignTop:与别人上对齐
注意:可以连用,如layout_above与layout_alignLeft一起就是在别人的上边且左对齐。
3.例子
与图3-1相对应的代码见下:
<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" android:orientation="horizontal"><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="→" android:id="@+id/rightRightButton" android:elegantTextHeight="false" android:layout_alignParentBottom="true" android:layout_alignParentEnd="true" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="↑" android:id="@+id/rightUpButton" android:layout_above="@+id/rightDownButton" android:layout_alignLeft="@+id/rightDownButton" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="←" android:id="@+id/rightLeftButton" android:layout_toLeftOf="@+id/rightDownButton" android:layout_alignTop="@+id/rightDownButton" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="↓" android:id="@+id/rightDownButton" android:layout_toLeftOf="@+id/rightRightButton" android:layout_alignTop="@+id/rightRightButton" /></RelativeLayout>图3-1 见下:
图 3-1 monitor小键盘布局
0 0
- Android 布局:相对布局
- android相对布局 相对对齐
- android之相对布局
- android 相对布局
- Android 相对布局
- Android中的相对布局
- android之相对布局
- android 相对布局心得
- android 相对布局
- android 相对布局属性
- android相对布局
- Android相对布局
- android 相对布局属性
- Android 相对布局
- Android中的相对布局
- android 相对布局小结
- android 相对布局
- Android相对布局
- 【步兵 经验篇】关于脚本语言的优势
- 4.7
- POJ2387 Til the Cows Come Home(最短路径)
- openwrt之MTKWIFI驱动之查找周边的SSID
- IE8如何显示html5元素
- 【android】相对布局
- 【U3D日记-2016年4月7日】入职一个月
- Linux系统的下载及VMware的下载
- Android实现图片滚动控件,含页签功能,让你的应用像淘宝一样炫起来
- 支持向量机SVM算法学习(一)
- XML解析之pull解析
- unity3d中脚本生命周期(MonoBehaviour lifecycle)
- IOS中的数据存储方式,特点,使用情况
- Spring3.1.1+Jersey2.2+ehcache实现WebApp与服务器接口交互获取令牌及校验过程