• 用户View,五大布局


    1、LinearLayout 线性布局

    android:orientation="horizontal" 制定线性布局的排列方式

          水平 horizontal

          垂直 vertical

    gravity 控制当前控件内容显示区域

    layout_gravity 当前控件在父元素的位置

    Layout_weightSum Layout_weight 额外空间分配(权重)

    android:visibility="invisible" 控制布局是否显示

          显示 visible

          不显示,但占空间 invisible

          隐藏 gone

    2、RelativeLayout 相对布局

    android:layout_toRightOf 在指定控件的右边

    android:layout_toLeftOf 在指定控件的左边

    android:layout_above 在指定控件的上边

    android:layout_below 在指定控件的下边

    android:layout_alignBaseline 跟指定控件水平对齐

    android:layout_alignLeft 跟指定控件左对齐

    android:layout_alignRight 跟指定控件右对齐

    android:layout_alignTop 跟指定控件顶部对齐

    android:layout_alignBottom 跟指定控件底部对齐

    android:layout_alignParentLeft 是否跟父布局左对齐

    android:layout_alignParentTop 是否跟父布局顶部对齐

    android:layout_alignParentRight 是否跟父布局右对齐

    android:layout_alignParentBottom 是否跟父布局底部对齐

    android:layout_centerVertical 在父布局中垂直居中

    android:layout_centerHorizontal 在父布局中水平居中

    android:layout_centerInParent 在父布局中居中

    3、AbsoluteLayout 绝对布局

    android:layout_x 指定控件在父布局的x轴坐标

    android:layout_y 指定控件在父布局的y轴坐标

    4、FrameLayout 帧布局

    帧布局每次添加的控件都显示在最上面,最后显示在界面上的是最后添加的一个控件

    5、TableLayout 表格布局

    android:shrinkColumns 收缩列

    android:stretchColumns 拉伸列

    android:collapseColumns 隐藏列

    android:layout_column 指定列(作用在列的身上)

    android:layout_span 合并列(作用在列的身上)

    TableRow单元行里的单元格的宽度小于默认的宽度时就不起作用,其默认是fill_parent,高度可以自定义大小

  • 相关阅读:
    BIOS/MBR UEFI/GPT关系与区别-资料整理
    raid 简单了解
    MBR主引导记录
    linux 安装vscode
    chrome 获得点击按钮时的事件
    python计算纪念日相关
    python error: curl: (1) Protocol "'https" not supported or disabled in libcurl
    linux go with vscode
    postman 进阶技巧
    mysql常用时间函数与类型转换
  • 原文地址:https://www.cnblogs.com/zzw1994/p/4884728.html
Copyright © 2020-2023  润新知