※※※ excerpted from http://www.cnblogs.com/salam/archive/2010/10/20/1856793.html
LinearLayout is a linear layout control that contains child controls that are arranged in a horizontal or vertical manner, with all widgets or other containers arranged in a relative position, and some controls will be missing or disappear when the boundary is exceeded. so each line of a vertical list will have only one widget or container, no matter how wide they are, and a horizontal list will have only one row high (height is the height of the highest child control plus the border height). The linearlayout maintains the spacing between the widgets it contains or the container and aligns with each other (right-aligned, Middle-aligned, or left-aligned relative to a control).
API description
XML properties
Android:baselinealigned: Whether the user is allowed to adjust the baseline of its content.
Android:baselinealignedchildindex: When a linear layout is part of a baseline alignment with another layout , It can specify the baseline alignment of its content.
Android:gravity: Specifies how to place the contents of this object (x/Y coordinate values) in the object.
Android:orientation: Sets the orientation of its contents (landscape/vertical).
The most important thing is that we can assign weights to the components in the layout to fill the remaining blanks.
LinearLayout also supports specifying padding weights for the widgets or container that it contains. The advantage is that it allows the widget or container that it contains to fill the remaining space on the screen. This also avoids the case of a bunch of widgets or containers in a large screen, allowing them to enlarge the padding. The remaining space is assigned a screen according to the weights specified by these widgets or containers. The default weight value is 0, which indicates that the widgets or containers actual size, if higher than 0, will container the remaining free space, split the size depending on each widget or container layout_ Weight and the proportion of that weight in all widgets or containers. For example, if you have three text boxes, where two of the weights you specify are 1, then the two text boxes will zoom in and fill the remaining space, and the third text box will not enlarge to show the actual size. If the first two text boxes are given a value of 2, one is 1, the remaining space after the third text box is displayed, the 2/3 weight of the room is 2, and the 1/3 size is 1. The greater the weight, the greater the importance.
If LinearLayout contains sub-linearlayout, the greater the weight between the sub-linearlayout, the less important. If there is a weight value of 2,d for LinearLayout A that contains linearlayout c,d,c, then the 1 of the screen's 2/3 space is given a value of 1 for the D,1/3 to the weight of 2 C. In the case of linearlayout nesting, the sub-linearlayout must set the weight, otherwise the default is not set the weight of the child linearlayout occupy the entire screen.
LinearLayout of Android UI