Android layout file attributes)

Source: Internet
Author: User
Common attributes

Android: id --- specify the corresponding ID for the control
Android: text --- specifies the text displayed in the control. Note that strings in the strings. xml file should be used as much as possible here.
Android: grimace --- specifies the basic position of the control, such as center and right. Here, the text position in the control is not the control itself.
Android: textSize --- specify the font size in the control
Android: background --- specifies the background color used by the control. The RGB naming method is used.
Android: width --- specify the width of the control
Android: height --- specify the height of the control
Android: padding * --- specifies the padding of the control, that is, the content in the control.
Android: sigleLine --- if set to true, the content of the control is displayed in the same row.

The following describes the relative layout attributes: RelativeLayout

Android: layout_above: place the bottom of the control above the given ID Control
Android: layout_below: place the top of the control under the control with the given ID
Android: layout_toLeftOf align the right edge of the control with the left edge of the control with the given ID
Android: layout_toRightOf align the left edge of the control with the right edge of the control with the given ID

Android: layout_alignBaseline the baseline of the control is aligned with the baseline of the control with the given ID
Android: layout_alignBottom: Align the bottom edge of the control with the bottom edge of the given ID Control
Android: layout_alignLeft: Align the left edge of the control with the given ID
Android: layout_alignRight: Align the right edge of the control with the right edge of the given ID Control
Android: layout_alignTop: Align the top edge of the control with the top edge of the control given ID

Android: alignParentBottom if the value is true, the bottom of the control is aligned with the bottom of the parent control.
Android: layout_alignParentLeft if the value is true, the left side of the control is aligned with the left side of the parent control.
Android: layout_alignParentRight if the value is true, the right side of the control is aligned with the right side of the parent control.
Android: layout_alignParentTop if the value is true, the top of the control is aligned with the top of the parent control.

Android: layout_centerHorizontal
Android: layout_centerInParent if true, the control will be centered in the horizontal and vertical directions of the parent Control
Android: layout_centerVertical if true, the control will be centered in the vertical direction
Android: layout_marginLeft this attribute is used to set the gap between controls (the gap between controls and the padding is different)
Android: padding = "3dip" indicates that the padding on the four sides is 3dip.

TableLayout

<TableLayout xmlns: android = "http://schemas.android.com/apk/res/android"
Android: orientation = "vertical"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Android: stretchColumns = "0"
> </TableLayout>

Android: stretchColumns = "0" the first column fills the entire row as the stretch Column

EditText attribute description

Android: scrollHorizontally
Set whether to display a horizontal bar when the text exceeds the TextView width.

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.