Five major layouts for Android learning----

Source: Internet
Author: User

1. LinearLayout Linear layout

android:orientation= "Horizontal" to make a linear layout arrangement

Horizontal Horizontal

Vertical Vertical

Gravity control the current control content display area

Layout_gravity the position of the current control in the parent element

Layout_weightsum Layout_weight Additional space allocation (weight)

android:visibility= "Invisible" controls whether the layout is displayed

Show visible

Do not display, but Occupy space invisible

Hide Gone

2, Relativelayout relative layout

Android:layout_torightof on the right side of the specified control

Android:layout_toleftof on the left side of the specified control

Android:layout_above the top of the specified control

Android:layout_below the bottom of the specified control

Android:layout_alignbaseline horizontal alignment with the specified control

Android:layout_alignleft left-aligned with the specified control

Android:layout_alignright right-aligned with the specified control

Android:layout_aligntop aligns with the top of the specified control

Android:layout_alignbottom aligns with the bottom of the specified control

Android:layout_alignparentleft is left-aligned with the parent layout

Android:layout_alignparenttop is aligned with the top of the parent layout

Android:layout_alignparentright is right-aligned with the parent layout

Android:layout_alignparentbottom is aligned with the bottom of the parent layout

Android:layout_centervertical Center vertically in the parent layout

Android:layout_centerhorizontal Center horizontally in parent layout

Android:layout_centerinparent Center in parent layout

3, Absolutelayout Absolute layout

ANDROID:LAYOUT_X Specifies the x-axis coordinates of the control in the parent layout

ANDROID:LAYOUT_Y Specifies the y-axis coordinates of the control in the parent layout

4. Framelayout Frame Layout

Frame layouts Each added control is displayed at the top, and the last one displayed on the interface is the last control added

5. tablelayout Table Layout

Android:shrinkcolumns Shrinking columns

Android:stretchcolumns Stretching columns

Android:collapsecolumns Hidden columns

Android:layout_column specified column (action on the body of the column)

Android:layout_span merge Columns (acts on the body of the column)

TableRow cells in a cell row are less wide than the default width, default is fill_parent, height can be custom size

Five major layouts for Android learning----

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.