LinearLayout is usually developed in a very common linear layout, divided into horizontal and vertical 2 kinds, the author found in the actual use of the following problems, hoping to help others.
The horizontal linearlayout, which have no effect on the properties of the x-coordinate, for example layout_gravity="right"
, can be layout_marginXXX
controlled by a variety of attributes, or by taking a position in the middle Plug view, or by switching to framelayout or relativelayout;
Vertical LinearLayout, any property that sets the y-coordinate does not work, for example layout_gravity="bottom"
, but we can use various layout_marginxxx properties to control, only the properties that control the x-coordinate will work, such as layout_gravity="right"
;
The reason is because, for example, the vertical linearlayout, then his sub-view on the y-axis of the coordinate algorithm is basically fixed.
LinearLayout Layout Issues