android随笔之RelativeLayout的常用xml属性

常 用的RelativeLayoutxml属性

应该都知道的:

android:layout_width        

android:layout_height      

 

设置为true或false的

android:layout_alignPraentBottom        设置在父控件的底部

android:layout_alignPraentEnd            将控件的结束位置与父控件的结束位置紧贴

android:layout_alignPraentStart           将控件的起始位置从父控件的起始位置开始

android:layout_alignPraentLeft            设置在父控件的左部

android:layout_alignPraentRight          设置在父控件的右边

android:layout_alignPraentTop            将控件的上边与父控件紧贴

 

android:layout_centerInParent             放在父控件的中心(水平居中+垂直居中)

android:layout_centerVertical              设置垂直居中

android:layout_centerHorizontal          设置水平居中

 

需要指定控件id的

android:layout_alignBaseLine       将给定id的控件的位置作基线,然后让两个空间在同一条线上

android:layout_alignBottom         将当前控件的底部匹配给定控件的底部

android:layout_alignLeft              将当前控件的左边匹配给定控件的左边

android:layout_alignEnd              将当前控件的底部匹配给定控件的底部

android:layout_alignRight            将当前控件的右边与给定控件的右边匹配

android:layout_alignStart             将当前控件的起始部分与给定控件的起始部分对齐

android:layout_alignTop              将当前控件的上边与给定控件的上边对齐

 

android:layout_above                   将当前控件放在指定控件的上方

android:layout_below                  将当前控件放在指定控件的下方

android:layout_toLeftOf              将当前控件放在指定控件的左边

android:layout_toRightOf             将当前控件放在指定控件的右方

android:layout_toStartOf              将当前控件放在指定控件的前边

 

 需要指定维度值的

android:layout_margin                

android:layout_marginBottom      (Specifies extra space on the bottom side of this view.)

android:layout_marginLeft           指定这个控件底部左边的空间(Specifies extra space on the left side of this view. )

android:layout_marginRight         指定这个控件底部右边的空间(Specifies extra space on the right side of this view. )

android:layout_marginTop            指定这个控件底部上边的空间(Specifies extra space on the top side of this view. )

android:layout_marginStart          (Specifies extra space on the startside of this view.)

android:layout_marginEnd           (Specifies extra space on the endside of this view. )

 

 

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值