android:layout_weight属性告知线性布局如何进行子组件的布置安排。
今天来探究一下android:layout_weight的工作原理
如果控件设置了自生的layout_width属性,wrap_content,layout_weight属性值就会进行额外空间的分配。
如果控件设置了自生的layout_width属性为0dp,那么layout_weight就会按照比例值来分配所有的空间,而不是额外的空间分配。
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.