文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 计算机软件及应用 > relativelayout属性
侵权投诉

relativelayout属性

收集的两篇布局的比较

ndroid RelativeLayout属性

// 相对于给定ID控件

android:layout_above 将该控件的底部置于给定ID的控件之上;

android:layout_below 将该控件的底部置于给定ID的控件之下;

android:layout_toLeftOf 将该控件的右边缘与给定ID的控件左边缘对齐;

android:layout_toRightOf 将该控件的左边缘与给定ID的控件右边缘对齐;

android:layout_alignBaseline 将该控件的baseline与给定ID的baseline对齐;

android:layout_alignTop 将该控件的顶部边缘与给定ID的顶部边缘对齐;

android:layout_alignBottom 将该控件的底部边缘与给定ID的底部边缘对齐;

android:layout_alignLeft 将该控件的左边缘与给定ID的左边缘对齐;

android:layout_alignRight 将该控件的右边缘与给定ID的右边缘对齐;

// 相对于父组件

android:layout_alignParentTop 如果为true,将该控件的顶部与其父控件的顶部对齐; android:layout_alignParentBottom 如果为true,将该控件的底部与其父控件的底部对齐; android:layout_alignParentLeft 如果为true,将该控件的左部与其父控件的左部对齐; android:layout_alignParentRight 如果为true,将该控件的右部与其父控件的右部对齐; // 居中

android:layout_centerHorizontal 如果为true,将该控件的置于水平居中;

android:layout_centerVertical 如果为true,将该控件的置于垂直居中;

android:layout_centerInParent 如果为true,将该控件的置于父控件的中央;

// 指定移动像素

android:layout_marginTop 上偏移的值;

android:layout_marginBottom 下偏移的值;

android:layout_marginLeft 左偏移的值;

android:layout_marginRight 右偏移的值;

example:

android:layout_below = "@id/***"

android:layout_alignBaseline = "@id/***"

android:layout_alignParentTop = true

android:layout_marginLeft = “10px”

[java] view plaincopy

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="doc.guandang.net;

android:layout_width="fill_parent"

android:layout_height="fill_parent">

<TextView

android:id="@+id/label"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="Type here:"/>

<EditText

android:id="@+id/entry"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:background="@android:drawable/editbox_background"

android:layout_below="@id/label"/>

<Button

android:id="@+id/ok"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/entry"

android:layout_alignParentRight="true"

android:layout_marginLeft="10dip"

android:text="OK" />

第1页

你可能喜欢

热门文档

相关文档

  • RelativeLayout重要的属性

    RelativeLayout重要的属性_IT/计算机_专业资料。androidRelativeLayout 用到的一些重要的属性: 第一类:属性值为 true 或 false android:layout_centerHrizontal 水平...

  • RelativeLayout的常用属性

    RelativeLayout的常用属性_IT/计算机_专业资料。android开发中,用户界面relativelayout布局的介绍第一类:属性值为 true 或 false android:layout_centerHrizontal 水平...

  • RelativeLayout常用属性详解1

    第一类: 属性值为ture或者false android:layout_centerHorizontal: 水平居中 android:layout_centerInParent : 相对父元素居中 android:layout_centerVertical : 垂直...

  • Android RelativeLayout属性大全

    Android RelativeLayout属性大全_IT/计算机_专业资料。基础知识// 相对于给定ID控件 android:layout_above 将该控件的底部置于给定ID的控件之上; android:layout_...

  • Android RelativeLayout属性大全

    layout_gravity 控件本身相对于父视图的位置 //此属性值为带单位的数值 在所有视图中都可使用 android:padding —— 指定控件的四周的内部留出一定的空间 android:...

  • Android中RelativeLayout各个属性的含义

    Android中RelativeLayout各个属性的含义_互联网_IT/计算机_专业资料。Android中RelativeLayout各个属性的含义android:layout_above="@id/xxx" --将控件置于给定ID...

  • Android 布局 LinearLayout与RelativeLayout的布局属性

    Android 布局 LinearLayout与RelativeLayout的布局属性_互联网_IT/计算机_专业资料。Android 布局 LinearLayout与RelativeLayout的布局属性...

  • Android RelativeLayout属性

    Android RelativeLayout属性_计算机软件及应用_IT/计算机_专业资料。一些常用的Android的相对布局属性RelativeLayout http://wenku.baidu.com/view/2e39724333687e21...

  • RelativeLayout的常见属性参数

    RelativeLayout的常见属性参数_计算机硬件及网络_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 RelativeLayout的常见属性参数_计算机硬件及网络_IT/计算机...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email