Notes on common layout in android development: android Development Layout

Source: Internet
Author: User

Notes on common layout in android development: android Development Layout
Notes on common la s

Linear layout:
  • The layout must be horizontal or vertical.
  • In the vertical layout, only the left-aligned and right-aligned horizontal center takes effect.
  • In the horizontal layout, only the top and bottom alignment align vertically.
  • Weight: the remaining part of the screen is allocated proportionally to the component (that is, the remaining part of the screen is allocated by weight after the component length is allocated first) therefore, we recommend that you set the component length or width to 0 DP when using the weight.
Relative layout:
  • The default positions of components are in the upper left corner, and the components can overlap.
  • It can be aligned to the upper, lower, and left sides of the parent element. It is perpendicular to the horizontal center of the parent element, and horizontally and vertically centered at the same time.
  • It can be aligned to the upper, lower, and left of other components.
  • It can be laid out in the upper, lower, and lower layers of other components.
Frame layout:
  • The default positions of components are in the upper left corner, and the components can overlap.
  • You can set the horizontal center relative to the top, bottom, and left of the element. The setting method is the same as the linear layout.
Table layout:
  • Each TableRow subnode represents a row, and each subnode of the node represents a column.
  • The width of each TavleRow subnode is the content of the package by default and cannot be changed. Therefore, you do not need to set
  • The width and height of each TableRow sub-node are enclosed in the content and cannot be changed.
Absolute layout:
  • Because the resolution problem of android phones is unimaginable when it is applicable to mobile phones, the relative layout is almost unnecessary.

 

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.