Learn about Android development from scratch-layout properties

Source: Internet
Author: User

Android:id specify the appropriate ID for the control

ANDROID:TEXT Specifies the text that is displayed in the control, it is important to note that the string in the Strings.xml file is used as much as possible.

android:gravity Specifies the alignment of the view component, such as center, right, and so on, which refers to the position of the text in the control, not the control itself.

Android:layout_gravity (differs from: android:gravity) Specifies the alignment of the container component. For example, a button in the LinearLayout, you want to put the button on the left, right and other positions can be set by this property. Take button For example, android:layout_gravity= "right" button on

Android:textsize Specifies the size of the font in the control

Android:background Specifies the background color used by the control, and the RGB naming method

Android:width The width of the specified control

Android:height The height of the specified control

Android:layout_width specifying the width of the container component

Android:layout_height specifying the height of the container component

Android:layout_weight a very important attribute in view, dividing the space proportionally

android:padding* Specifies the padding for the control, meaning that the contents of the control

Android:sigleline If set to True, the contents of the control are displayed in the same row

Android:scaletype is a size that controls how the picture resized/moved to the ImageView

Android:layout_centerhrizontal Horizontal Center

Android:layout_centervertical Vertical Center

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_alignparentright 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 cannot be found, then the parent element is the reference.

Android:layout_below at the bottom of an element

Android:layout_above at the top of an element

Android:layout_toleftof on the left side of an element

Android:layout_torightof on the right side of an element

Android:layout_aligntop aligns the top edge of this element with the top edge of an element

Android:layout_alignleft aligns the left edge of this element with the left edge of an element

Android:layout_alignbottom aligns the bottom edge of this element with the bottom edge of an element

Android:layout_alignright aligns the right edge of this element with the right edge of an element

Android:layout_marginbottom distance from the bottom edge of an element

Android:layout_marginleft distance from the left edge of an element

Android:layout_marginright distance from the right edge of an element

Android:layout_margintop distance from the top edge of an element

Android:paddingleft the distance of this element content from the right edge of this element

Android:paddingright the distance of this element content from the top edge of this element

Android:hint the prompt in the input box when setting EditText to null

Android:linearlayout It determines the direction of the LinearLayout, whose value can be vertical, which represents the vertical layout horizontal, which represents the horizontal layout

Learn about Android development from scratch-layout properties

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.