Android Common layout

Source: Internet
Author: User

/*----------------------------------------* * Describes a few summaries of--layout. *-Describe--S1. Android's five layouts: *    linearlayout (linear layout): Common *    relativelayout (relative layout): Common *    framelayout (frame layout): Common *    GridLayout (Grid layout) [New grid layout after 4.0]: use less *    tablelayout (table layout): Almost no.-Description of the--S2. * * Description--S3. *-Description--none. *--------------- ------------------------------------------------------------*/
/*----------------------------------------* * describes--linearlayout's summary. *-describes--s1. Several important properties of linear layout: *---Basic properties: * ID identification, unique identification * Layout_width width, layout/control width * Layout_height high, layout/control height * Background set background, can be set to color or picture etc * *---characteristic properties of linear layout: * Orientat     Ion layout direction, HORIZONTAL or Vertical * WeightSum Specifies how many copies of the layout direction * layout_weight child controls (weight) *---Alignment properties: * Gravity Specifies the gravity property of the child control * Layout_gravity the gravity property of the relative parent layout * Padding (left/right/top/button/start/end) Inward squeezing the child controls * Layout_margin (LEFT/RIGHT/TOP/BUTTON/S Tart/end) Extrusion of the parent control (layout) *---Other properties: * Tag another flag, similar ID * onclick/visibility/alpha/* * * Description--s2.padding/layout_margin start/ End API17 start support, recommended start/end. *-Description--S3. Note The interaction or conflict relationship between controls, or the result of the layout does not match the expected, * if the specified orientation is vertical, the gravity vertical direction property of the child control is invalidated. * If the specified orientation is vertical, the direction of the weightsum is also vertical. *-Describe--none. *---------------------------------------------------------------------------*//*----------------------------------------* * describes--relativelayout's summary. *- Description--s1. Several important properties of the relative layout: *---Basic properties: * ID identification, unique identification * layout_width width, layout/control width * layout_height height, layout/control's altitude * Backgrou nd set the background, can be set to color or picture, etc. * *---specific properties of relative layout: * LAYOUT_XXX (Toleftof/torightof/below/above) relative to sibling control's Position property * Layout_align (left/r Ight/top/button) relative to the sibling control's Alignment property * Layout_alignparent (Left/right/top/button) The position alignment property for the parent control * Layout_center (horizontal/v Ertical/inparent) Centered property relative to the parent control * *---Alignment property: * Gravity Specifies the gravity property of the child control * Layout_gravity The Gravity property of the relative parent layout * Padding (left /right/top/button/start/end) extrude the child control Layout_margin (left/right/top/button/start/end) outward extrusion of the parent control (layout) * *---Other properties: * Tag Another Logo, similar ID * onclick/visibility/alpha/* * * Description--s2.padding/layout_margin start/end API17 start support, recommended start/end. *-Description--S3. Note The interaction or conflict relationship between the controls, or the result of the layout does not match the expectations, * if the position of one child control conflicts with another, the resulting position becomes confusing because the position of the child controls is relative. *-Describe--none. *---------------------------------------------------------------------------*//*----------------------------------------* * describes--framelayout's summary. *-describes--s1. Several important properties of frame layout: *---Basic properties: * ID identification, unique identification * Layout_width wide, layout/control width * Layout_height high, layout/control height * Background set background, can be set to color or picture etc * *---unique properties of frame layout: * foreground Set foreground, can be set to color or picture etc * foregroundgravity set foreground gravity properties * *---Alignment properties: * Layout_gravity gravity property of relative parent layout * Padding (left/right/t  Op/button/start/end) Squeeze the child control Inward * Layout_margin (left/right/top/button/start/end) outward extrusion of the parent control (layout) *---Other properties: * Tag another flag, similar ID * onclick/visibility/alpha/* * * Description--s2.padding/layout_margin start/end API17 start support, recommended start/end. *-Description--S3. Each property is specified once, and multiple values can be used | (or) to connect together. *-Description--S4. The frame layout child controls are stacked on a container by layer, so there is no conflict between the positions of the child controls * You can implement a stacked layout of the controls--description--s5. The Frame layout overlay properties are added in the order of layout, and the controls that are placed behind are stacked on the preceding controls. *-Describe--none. *---------------------------------------------------------------------------*//*----------------------------------------* * describes--gridlayout's summary. *- Describes--s1. Several important properties of the grid layout: *---Basic properties: * ID identification, unique identification * layout_width width, layout/control width * layout_height height, layout/control's altitude * Backgrou nd set the background, can be set to color or picture, etc. * *---Specific properties of the grid layout: * rowCount Table rows * ColumnCount table columns * Layout_columnspan How many columns the cell spans (combined with Layout_gra Vity property used) * Layout_rowspan How many rows the cell spans (in combination with the Layout_gravity property) * Layout_column cell column * layout_row cell row *---Alignment Properties: * Layout_gravity The Gravity property of the relative parent layout * Padding (left/right/top/button/start/end) Inward extruding child controls * Layout_margin (left/right/top /button/start/end) Extrusion of the parent control (layout) * *---Other properties: * Tag another flag, similar ID * onclick/visibility/alpha/* * * Description--s2.padding/layout_marg In Start/end API17 start support, recommended start/end. *-Description--S3. Note The interaction or conflict between the controls, or the result of the layout does not match the expected * New cells cannot span empty cells, otherwise they do not conform to the expected *-Description--S4. The property with Layout_ is the property of the relative parent control, without the property of the specified (relative) child control-* Describes--none. *---------------------------------------------------------------------------*/

Android Common layout

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.