zoukankan      html  css  js  c++  java
  • android:layout_weight属性详解

    1.

    按比例显示LinearLayout内各个子控件,需设置android:layout_width="0dp",如果为竖直方向的设置android:layout_height="0dp"。在这种情况下某子个控件占用LinearLayout的比例为:本控件weight值
    / LinearLayout内所有控件的weight值的和。

    2.

    所以,要对weight做了解,要深深的理解下面两句话:   在layout_width设置为fill_parent的时候,layout_weight所代表的是你的控件要优先尽可能的大,但这个大是有限度的,即fill_parent.   在layout_width设置为wrap_content的时候,layout_weight所代表的是你的控件要优先尽可能的小,但这个小是有限度的,即wrap_content.   layout_height 同 layout_width.

    本篇文章来源于 Linux公社网站(www.linuxidc.com)  原文链接:http://www.linuxidc.com/Linux/2013-07/87418.htm

  • 相关阅读:
    A+B Problem
    迭代平方根
    猴子报数
    分数求和
    猴子吃桃
    钻石
    杨辉三角形
    MYSQL 5.7 修改密码、登录问题
    SQL 语句 explain 分析
    重构CMDB,避免运维之耻
  • 原文地址:https://www.cnblogs.com/SZ2015/p/4556932.html
Copyright © 2011-2022 走看看