Android_6android common layout

    1. Linear layout: LinearLayout,

       android: orientation = "vertical" vertical layout, the two components can not be on the same line

 

 

       android: orientation = "horizontal" landscape layout, the two components can not be in the same column.

 

     2. Relative layout relativeLayout, the default layout, controls, default start drawing from the upper left corner

Textview can see five are put together, you can use if you want to control the position id to specify the location

 

 

 

 

Similar statements also

 

 

 

 

 

 

 

I found on the right, but not directly to the right, so you also need:

 

 

 

 Provided at the center of the vessel

 

 

 

 

 Level control center

 

 

 

 

Controlling vertical centering

 

 

Aligned with the bottom of the container:

 

 

 

 Use of the above statements, we can be flexible layout

    3. the FrameLayout frame layout, the layout is relatively similar, but only the layout in nine positions:

If the position is not set, nine components are put together, you can not move in any position.

 

 Only appear in this nine positions:

 

 If the condition of many things such as third textview can use the android: layout_gravity = | to declare "center_horizontal bottom", if the conditions are multi-purpose | separated them, you can also use margin to control margins, move your position, but can only be 9 position

    4. The table layout TableLayout

Linear layout similar to a vertical direction, each control occupying an entire row.

 

 You can also let his party more control, you need labels with tablerow

 

 

 

     5. Absolute layout AbsoluteLayout (obsolete) will no longer show. As for why will expire, he will specify the distance, but with the development of Android phones each sample sizes, if different users experience different fixed formats from your phone.

 

Guess you like

Origin www.cnblogs.com/tkg1314/p/12383261.html