Five layout modes for Android

Source: Internet
Author: User
1. framelayout framework Layout
All soft controls can only be listed in the upper left corner, and complex la s are not allowed.
2. linelayout Linear Layout
You can set its vertical or horizontal attribute values to arrange all elements. All elements are stacked behind other elements. Each row in the vertical list has only one element, while the horizontal list has only one row height. The line production layout may be complicated. Can be nested.
3. absolutelayout absolute Layout
All child elements specify the exact X and Y coordinate values and are displayed on the screen. There is no page border in the absolute layout, and the allowed elements overlap with each other.
4. Relative layout of relativelayout
It can be understood that an element is a reference object to locate the layout. All child elements specify their locations relative to other or parent elements. Align left and right, or up or down, or in the center of the screen to arrange two elements. Elements are arranged in order. Therefore, if the first element is in the center of the screen, other elements relative to the element are arranged in the relative position in the center of the screen.
5. tablelayout table layout
Similar to the table in HTML, assign the positions of child elements to rows or columns. A tablelayout consists of many tablerow. Each tablerow defines a row. The tablelayout container does not display the border lines of row, cloumns, or cell. Each row has 0 or more cells;

Note: The layout format can be nested.

Related Article

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.