zoukankan      html  css  js  c++  java
  • Android之RelativeLayout相对布局

    1、相关术语解释

    1、基本属性
        gravity :设置容器内组件的对齐方式
        ignoreGravity : 设置该属性为true的组件,将不受gravity属性的影响
    
    2、根据父容器定位
        layout_alignParentLeft : 左对齐
        layout_alignParenRight : 右对齐
        layout_alignParentTop : 顶部对齐
        layout_alignParentButtom : 底部对齐
        android:layout_centerHorizontal :水平居中
        android:layout_centerVertical : 垂直居中
        android:layout_centerInParent : 中间位置
    
    3、根据兄弟组件定位
        layout_toLeftOf : 参考组件的左边
        layout_toRightOf: 参考组件的左边
        layout_above : 参考组件的上方
        layout_below : 参考组件的下方
        layout_alignTop :对齐参考组件的上边界
        layout_alignBottom : 对齐参考组件的下边界
        layout_alignLeft: 对齐参考组件的左边界
        layout_alignRight : 对齐参考组件的右边界
    
    4、margin(偏移)
        设置组件与父容器的边界
        layout_margin 设置组件上下左右的偏移量
        layout_marginLeft 设置组件离左边的偏移量
        layout_marginRight 设置组件离右边的偏移量
        layout_marginTop 设置组件离上面的偏移量
        layout_marginButtom 设置组件离下面的偏移量
    
    5、padding(填充)
        设置组件内部元素间的边距(比如TextView里的字体位置)
        android:padding 往内部元素的上下左右填充一定边距
        paddingLeft 往内部元素的左边填充一定边距
        paddingRight 往内部元素的右方填充一定边距
        paddingTop 往内部元素的上方填充一定边距
        paddingBottom 往内部元素的下发填充一定边距
  • 相关阅读:
    司马光 王安石
    辛弃疾
    伯仲叔季
    三国时代
    西汉 东汉 三国(曹魏 蜀汉 东吴)
    数量关系练习题
    为什么不推荐使用外键约束
    Google Map API申请
    Android传感器——加速度传感器
    第三届空间信息智能服务研讨会
  • 原文地址:https://www.cnblogs.com/xianfeng-zhang/p/7987973.html
Copyright © 2011-2022 走看看