Introduction to Android Layout properties

Source: Internet
Author: User

Android:id

Specify the corresponding ID for the control

Android:text

Specifies the text that the control displays, and it is important to note that the string in the Strings.xml file is used here as much as possible

Android:gravity

Specifies the alignment of the view component, such as center, right, and so on, where the text position in the control is not the control itself

Android:layout_gravity (difference 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 so on can be set through this property. Take button For example, android:layout_gravity= "right" button on
Android:textsize

Specifies the size of the control's font

Android:background

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

Android:width

Specifies the width of the control

Android:height

Specifies the height of the control

Android:layout_width

Specify the width of the container component

Android:layout_height

Specify the height of the container component

Android:layout_weight

Attributes that are very important in view, divide space proportionally

android:padding*

Specifies the padding for the control, which means 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 to control how the picture resized/moved to the ImageView size.

Android:layout_centerhrizontal

Center horizontally

Android:layout_centervertical

Center vertically

Android:layout_centerinparent

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

Assuming that the corresponding sibling element is not found, take the parent element as a 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

The distance from the bottom edge of an element

Android:layout_marginleft

The distance from the left edge of an element

Android:layout_marginright

Distance from the right edge of an element

Android:layout_margintop

The distance from the top edge of an element

Android:paddingleft

The distance of this element from the right edge of this element

Android:paddingright

The distance of the content of this element from the top edge of this element

Android:hint

Set the prompt information in the input box when EditText is empty

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

Introduction to Android Layout properties

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.