LinearLayout

来源:互联网 发布:r语言和c语言哪个难 编辑:程序博客网 时间:2024/06/05 10:43

LinearLayout:水平布局
1.android:orientation

Should the layout be a column or a row? Use “horizontal” for a row, “vertical” for a column. The default is horizontal.
垂直布局还是水平布局

2.等间距布局
水平等间距
这里写图片描述
分别从左往右
1.layout_width=”0dp”layout_height=”match_parent”layout_weight=”1”
2.layout_width=”0dp”layout_height=”match_parent”layout_weight=”2”
3.layout_width=”0dp”layout_height=”match_parent”layout_weight=”1”

首先确定是水平等距离还是垂直等距离,然后设置宽或高为0dp,然后设置layout_weight.
layout_weight如果不设置,默认是0,是这个view的默认大小

原创粉丝点击