Common layouts in Android

Source: Internet
Author: User

1. Linear Layout LinearLayout
Orientation: direction; vertical, vertical; horizontal, horizontal
Gravity: Alignment, the alignment of the child control relative to the current control
Layout_gravity: How the current control is aligned relative to the parent control
Margin: The spacing of the current control relative to four weeks.
padding: The spacing of the child controls in the current control relative to the current control.

2. Relative layout relativelayout are all starting from the upper left corner of the layout, to control the position you need to set the position of each control relative to the other controls.
Layout_below: Which control is located below
Layout_above: On top of which control
Layout_toleftof: Specifies which control is on the left side of the current control
Layout_torightof: Specifies the right side of the control to which the current control is located
Layout_alignparentright: The current control is based on the way the parent form
Layout_centerhorizontal: Horizontal Center
Layout_centervertical: Vertical Centering
Layout_centerinparent: In the middle of the parent form


3. Frame Layout Framelayout

The child controls in the frame layout are stacked up one layer at a level.

4. Table Layout tablelayouts
A TableRow in tablelayout represents a row, and a control in TableRow represents a column
5. Absolute layout (abandoned) absolutelayout

Common layouts in Android

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.