对LinearLayout下的子组件,使用layout_weight的总结
前提:是LinearLayout的子组件
1、两个子组件都设置设置android:layout_width="fill_parent";
组件A设置为android:layout_weight="1";
组件B设置为android:layout_weight="2";
效果是: A:B ==> 2:1;
总结:两个子组件都设置为android:layout_width="fill_parent",子组件所占的空间与layout_weight的值成反比。
LinearLayout布局详解
本文详细介绍了在LinearLayout中如何通过layout_weight属性来控制子组件的显示宽度。特别关注了当子组件设置为fill_parent时,不同layout_weight值对于组件大小的影响。

被折叠的 条评论
为什么被折叠?



