在xml中将两个要占屏幕一半的控件都加上android:layout_weight="1";

注意:weight只能用在LinearLayout布局中。

在LinearLayout布局中weight数值越大显示的优先权就越低。

相关文章: