Attention points for common layouts in Android development

Source: Internet
Author: User
Note points for common layouts Linear layout:
  • Must have a layout direction horizontal or Vertical
  • In vertical layout, only left-to-aligns alignment is applied in the horizontal center
  • Only top align bottom align vertical center in horizontal layout in effect
  • Weight: The component assigns the remainder of the screen proportionally (that is, the length of the component that is now assigned and then the remainder of the screen by weight), so it is recommended to set the component's length or width to 0DP.
Relative layout:
  • The default location of the component is the upper-left corner, which can overlap between components
  • Aligns vertically and horizontally relative to the parent element, centered in a vertical center relative to the parent element and centered horizontally and vertically
  • can be aligned up or down relative to other components
  • Can be layout with other components up or down
Frame layout:
  • The component default location is the upper-left corner and can overlap between components
  • You can set the relative to the character element up or down the horizontal center, set the same method and the linear layout
Table layout:
  • Each TableRow child node represents a row, and each child node of that node represents a column
  • The width of each tavlerow child node is the content of the package and cannot be changed, so it does not need to be set
  • The width and height of each TableRow child node are the contents of the package and cannot be changed, so no setting is required.
Absolute layout:
  • Due to the problem of the resolution of the Android phone the absolute layout is unthinkable when fitted to the phone, so the relative layout is almost no

Attention points for common layouts in Android development

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.