LinearLayout的weight属性的解释
刚刚在stackoverflow上看到一个关于android LinearLayout的weight属性的解释,觉得解释很透彻,帖过来和大家分享一下。 In a nutshell, layout_weight specifies how much of the extra space in the layout to be allocated to the View. LinearLayout supports assigning a weight to individual children. This attribute assigns an "importance" value to a view, and allows it to expand to fill any remaining space in the parent view. Views' default weight is zero. Calculation to assign any remaining space between child In general, the formula is: space assigned to child = (child's individual weight) / (sum of weight of every child in Linear Layout)