LinearLayout has two very similar properties: Android:gravity and Android:layout_gravity. The difference is that android:gravity is used to set the alignment of the view component, and android:layout_gravity is used to set the alignment of the container component.
Popular point is that:
The Android:gravity property is the qualification for the view content. For example, a button above the text. You can set the text on the left side of the view, on the right, and so on. This property is done with this.
Android:layout_gravity is used to set the position of the view relative to the parent view. For example, a button in the LinearLayout, you want to put the button on the left to the right and so on can be set by this property.
We get the most out of the layout, and then we have a few layouts, and if you want to make these layouts bottom, you can set the androi:gravity= "Botton" in the properties of the most out-of-layout, because gravity is working on the contents.
Which layouts are supported? Application restrictions?
When the LinearLayout property of the parent layout is androidrientation= "vertical", android:layout_gravity= "? "This will only take effect when the landscape is set to horizontal. such as: Left,right,center_horizontal, etc.
When the LinearLayout property of the parent layout is androidrientation= "Horizental", android:layout_gravity= "? "This is set to portrait when it takes effect. such as: Top,bottom,center_vertical and so on;
One of the more special is the center, whether it is horizontal or vertical, it always has a direction to work
Lianjie:http://www.cnblogs.com/xiaoran1129/archive/2013/03/26/2982733.html