Android's Common layout

Source: Internet
Author: User

linearlayout linear layout. Android:orientation= "Horizontal"set the arrangement of linear layouts horizontal horizontal vertical verticalgravity controls the current control content display area layout_gravity The position of the current control in the parent element Layout_weigh Tsumlayout_weight Additional space allocation (weight) android:visibility= "Invisible"controls whether the layout shows that the visible display does not display, but occupies space invisible hidden gonerelativelayout uses some of the important properties of the first class: The property value is True or False for Android:     Layout_centerhrizontal Horizontal Center android:layout_centervertical vertically centered android:layout_centerinparent is completely centered relative to the parent element Android:layout_alignparentbottom snaps to the bottom edge of the parent element Android:layout_alignparentleft snaps to the left edge of the parent element android:layout_alignparentr Ight snaps to the right edge of the parent element Android:layout_alignparenttop snaps to the top edge of the parent element android:layout_alignwithparentifmissing if the corresponding sibling element is not found To make a reference to the parent element the second class: The attribute value must be the referenced name of the ID "@id/id-Name "Android:layout_below" at the bottom of an element android:layout_above at the top of an element android:layout_toleftof the The left Android:layout_torightof is aligned to the right of an element android:layout_aligntop the top edge of this element and the top edge of an element android:layout_alignleft The left edge of the element is aligned with the left edge of a android:layout_alignbottom the bottom edge of this element and the bottom edge of an element are aligned android:layout_alignright the right edge of this element and the right edge of an element Zidi                   Three categories: attribute values are specific pixel values, such as 30dip,40px android:layout_marginbottom distance from the bottom edge of an element android:layout_marginleft                   The distance from the left edge of an element android:layout_marginright the distance from the right edge of an element android:layout_margintop The distance from the top edge of an element absolutelayout absolute layout/framelayout Frame Layout absolutelayoutandroid:layout_x Specifies the x-axis coordinates of the control in the parent layout android:layout_y Specifies that the control is in the parent layout's y-coordinate framelayout frame layout each time the added control is displayed at the top, and the last displayed on the interface is the last added control of the display unit px (pixels) pixels in the general HVGA represents 320x480 pixels, This is used more. Dip or DP (device independent pixels) devices independent pixels This is related to device hardware, which is generally recommended to support WVGA, HVGA, and QVGA, and does not depend on pixels. SP (scaled Pixels-best fortext size) scale pixels mainly handle the size of the font and can be adapted to the font of the system. In addition to the above three display units, there are several less commonly used: in (inches) inch mm (millimeters) mm PT (points) points,1/72 inch in order to adapt to different resolutions, different pixel densities, it is recommended to use Dip, text using SP. 

Android's 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.