Android_RelativeLayout(相对布局)

 布局属性 (以下是不据属性"注意 不是控件属性")如下:

int  ABOVE: 将 该控件 的 底部  放置于只定 ID  之上

android:layout_above="@id/xxx"

int BELOW:将 该控件 的 顶部  放置于只定 ID  之下

android:layout_below="@id/xxx"

int LEFT_OF:将 该控件 的 右边缘  放置于只定 ID  的左边对齐

android:layout_toLeftOf="@id/xxx"

int RIGHT_OF:将 该控件 的 左边缘  放置于只定 ID  的右边对齐

android:layout_toRightOf="@id/xxx"

 

int  ALIGN_LEFT:将 该控件 的 左边缘  放置于只定 ID  的左边对齐

int  ALIGN_RIGHT:将 该控件 的 右边缘  放置于只定 ID  的右边对齐

int  ALIGN_TOP:将 该控件 的 上边缘  放置于只定 ID  的上边对齐

int  ALIGN_BOTTOM:将 该控件 的 底边缘  放置于只定 ID  的底边对齐

 

int  ALIGN_BASELINE

 

int  ALIGN_PARENT_BOTTOM:如果值为true  将 该控件 的 底边缘  放置于 父控件的底边缘   默认值为“false”

int  ALIGN_PARENT_LEFT:如果值为true  将 该控件 的 左边缘  放置于 父控件的左边缘  默认值为“false”

int  ALIGN_PARENT_RIGHT:如果值为true  将 该控件 的 右边缘  放置于 父控件的右边缘  默认值为“false”

int  ALIGN_PARENT_TOP: 如果值为true  将 该控件 的 顶边缘  放置于 父控件的顶边缘  默认值为“false”

 

int CENTER_HORIZONTAL:如果值为true  水平居中

int CENTER_IN_PARENT: 如果值为true  水平垂直都是居中

int CENTER_VERTICAL: 如果值为true  垂直居中

TRUE

 

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:padding="10px"
    >
    <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/NOHAO"
    android:text="NOHAO"
    />
    <EditText
    android:id="@+id/exitText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/NOHAO"
    />
    <Button
    android:id="@+id/OK"
    android:text="确定"
    android:layout_alignParentRight="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/exitText"
   
    />
    <Button
    android:id="@+id/EXIT"
    android:text="取消"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignTop="@id/OK"
    android:layout_toLeftOf="@id/OK"
    />
   
</RelativeLayout>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值