Android five layouts

Source: Internet
Author: User

This content is based on learning in the web, plus the understanding of yourself, write down the notes so that later to view

Layouts can be arranged in layout again

1. Linear layout (LinearLayout)

This layout controls the vertical/horizontal arrangement of controls

LinearLayout common to two properties

1, android:orientation= "vertical (vertical)"/"Horizontal (horizontal)"

2, android:gravity = "center"---this property controls the location of its subclasses (written at the beginning of the total)

(Common attributes are available)

1, center_vertical: Vertical Center

2, Center_horizontal: Horizontal Center

3, Center: horizontal vertical is centered

4. Right: The subclass control is on the left side of the current control

5. Left: Sub-class controls are located on the Ieft side of the current layout

6. The bottom sub-class control is below the current

A, android:gravity = "center"---this property controls the location of its subclasses

B, android:layout_gravity= ""--the value itself is in the XY position of the current parent container (written in the control)

C, android:layout_weight= "1"---value itself as the proportion of the current parent class container


2. Relative layout (relativelayout)---sub-controls and how subclasses are arranged relative to the parent container position

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/84/13/wKiom1eEtz-TURQdAALzggYgCfA460.png-wh_500x0-wm_3 -wmp_4-s_608346159.png "title=" qq picture 20160712172151.png "alt=" Wkiom1eetz-turqdaalzggygcfa460.png-wh_50 "/>

The position of the control relative to the parent class

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/84/13/wKiom1eEvXzTrAxwAAPhvN5n3mQ172.png-wh_500x0-wm_3 -wmp_4-s_222415383.png "title=" qq picture 20160712175003.png "alt=" Wkiom1eevxztraxwaaphvn5n3mq172.png-wh_50 "/>

Control relative to the position of the control

This picture is for Mu class



3. Frame Layout (framelayout)

Allows overlay placement between controls and controls, such as neon lights, progress bars


4. Absolute layout (absolutelayout)---also known as XY coordinate layout (not adaptive)

Less use in development, because the size of the phone is not the same, the development of software in different phones may not be beautiful


5. Table layout (tablelayout)

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/84/16/wKioL1eFoIugW8gTAAMiGH4UtKM787.png-wh_500x0-wm_3 -wmp_4-s_3955071948.png "title=" qq picture 20160713095729.png "alt=" Wkiol1efoiugw8gtaamigh4utkm787.png-wh_50 "/>

This picture is for Mu class



This article from the "11828641" blog, reproduced please contact the author!

Android five layouts

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.