Android Common layout

Source: Internet
Author: User

First, linear layout linearlayout

    1. Function: Arranges the components in the container one by one, not only can control each component horizontal arrangement also can control each component longitudinal arrangement (through the Android:orientation property control)
    2. Features: Linear layout does not change the components of a love the rest of the components are not displayed after you arrange the head
Property:

    1. Android:gravity sets the alignment of components within the layout manager, which supports Top,bottom,left,right,center_vertical,fill_vertical,center_horizontal,fill _horizontal,center,fill,clip_vertical,clip_horizontal several property values, or you can specify a combination of multiple alignment options
    2. Android:orientation to set the arrangement of components within the layout manager
Second, table layout tablelayout

    1. Role: Table layouts are used to manage UI components in a row and column format
    2. Features: No clear declaration of the number of treasures, 20 by adding TableRow, other components to control the number of rows and columns of the table, each add a TableRow is a table row, TableRow is also a container, so it can continue to add other components, Add a column to each sub-component, and if you add the component directly to Tablelayout, the component will occupy a column directly
Property:

    1. Android:collapsecolumns sets the column number of the column that needs to be hidden, separated by commas between multiple column ordinals
    2. Android:shrinkcolumns sets the number of columns that are allowed to be shrunk, separated by commas between multiple ordinals
    3. Adnroid:stretchcolumns sets the number of columns allowed to be stretched, separated by commas between multiple column ordinals
three, frame layout framelayout

    1. Function: Creates a blank area (called a frame) for each component to which it is added
    2. Feature: All sub-components occupy one frame, and these frames are automatically aligned according to the Gravity property
Property:

    1. Android:foreground to set the foreground image of the frame layout container
    2. Android:foregroundgravity defining the Gravity property of the drawing foreground image
iv. Relative Layout relativelayout

    1. Role: Relative layout container The location of the subcomponents is always determined relative to the sibling component, the parent container, so this layout is called relative layout
    2. Features: If the position of a component is determined by the position of the B component, Android requires that the B component be defined before a component is defined
Property:

    1. Android:gravity to set the alignment of the sub-components within the layout container
    2. Android:ignoregravity set the effect of that component without gravity components
Five, absolute layout absolutelayout

    1. Function: Controls the position of the component by x-coordinate y-coordinate
    2. Features: When using Absolutelayout as a layout container, the layout container no longer manages the location, size of the child components
Property:

    1. Layout_x: Specifies the x-coordinate of the subassembly
    2. LAYOUT_Y Specifies the y-coordinate of the subassembly

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.