zoukankan      html  css  js  c++  java
  • 布局管理器要点

    线性布局管理器的layout-weight

    layout-weight就是控件所占空间的比例,比重。layout_weight是给LinearLayout的子控件使用的,其他布局无法使用。

    正确的用法为:
    在LinearLayout是垂直的时候,layout_weight将控制子控件的高度占总控件的百分比,这时子控件的layout_height要为0dp.
    在LinearLayout是水平的时候,layout_weight将控制子控件的宽度占总控件的百分比,这时子控件的layout_width要为0dp

    SDK讲解:

    我们如果在某个方向上使用了weight ,那么我们必须在对应的方向上将width设置为0dp. 它告诉了我们设置为0dp是因为使用weight,系统是采用了另外一套计算占用空间大小的算法的.(the weight value requires another width calculation to fill the remaining space.)

  • 相关阅读:
    3-2 案例准备工作
    3-1 Git下载与安装
    3-1 案例环境初始化
    1-2+并发编程初体验
    Linux
    HTTP
    Linux
    HTML
    Linux 命令
    MySQL
  • 原文地址:https://www.cnblogs.com/feng-ye/p/5750707.html
Copyright © 2011-2022 走看看