Some properties of Android commonly used instructions

Android:id - control to specify the corresponding ID

Android:text specifies that the control displays the text, note here is, as far as possible the use of string strings.xml file.

The basic position of android:grivity - specify the control, for example in the middle, in the right position here refers to the text in the control position and not control itself.

Android:textSize - specifies the size of the font controls

Android:background - specifies the background color used in the control, the RGB nomenclature

Android:width - specifies the width of the control

Android:height - specifies the height of the control

Android:padding* - specified padding controls, that controls the content

Android:sigleLine - if set to true, then the contents of the control are shown in the same row

Below is the relative layout attribute description: RelativeLayout

Android:layout_above the bottom of the control over a given ID control

Android:layout_below will be at the top of the control under the given ID controls

Android:layout_toLeftOf will control and the left edge of alignment of the right edge of the control and the given ID

Android:layout_toRightOf will be the right edge alignment of the control and the left edge of the given ID controls


Alignment of baseline android:layout_alignBaseline the baseline of the control and the given ID controls

Android:layout_alignBottom will be at the bottom of the bottom edge edge alignment with the given ID controls the control.

Android:layout_alignLeft align the left edge and the left edge of the control of the given ID controls

Android:layout_alignRight will be the right edge alignment of the right edge of the control and a ID control

Android:layout_alignTop will be at the top of the top edge with a given ID controls the control alignment


Android:alignParentBottom if the value is true, the bottom of the control and the parent control bottom alignment

Android:layout_alignParentLeft if the value is true, then the control on the left and the parent control left alignment

Android:layout_alignParentRight if the value is true, then the control right and the parent control right align

Android:layout_alignParentTop if the value is true, the top of the control and the parent control top alignment


Android:layout_centerHorizontal if true, the control will be for horizontal direction center

Android:layout_centerInParent if true, the control will be as the parent control the horizontal direction and the vertical direction of the central

Android:layout_centerVertical if true, the control will be as perpendicular to the direction of the central

This property is used to set the android:layout_marginLeft gap between controls (between controls and controls and between different)

android:padding="3dip"The padding quadrilateral 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 as the column to fill the whole line tension


The EditText property indicates

android:scrollHorizontally

Set the text beyond the width of the TextView case, whether there is cross brace.


The first class: property value is true or false

The level of android:layout_centerHrizontal in the middle

Android:layout_centerVertical vertical center

Android:layout_centerInparent relative to the parent element exactly centered

The lower edge of the parent element android:layout_alignParentBottom close

The left edge of the android:layout_alignParentLeft close to the parent element

The right edge of the android:layout_alignParentRight close to the parent element

On the edge of android:layout_alignParentTop close to the parent element

If the corresponding element of the android:layout_alignWithParentIfMissing brothers can not find the words to the parent element reference


Second categories: attribute value must be a reference name 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 in a certain elements on the left

Android:layout_toRightOf in a certain elements on the right


On the edge of the upper edge of the alignment of android:layout_alignTop elements and some elements of the

The left edge of the left edge of the alignment of android:layout_alignLeft elements and some elements of the

Android:layout_alignBottom this element edge alignment and the lower edge of an element of the

Right align the edge android:layout_alignRight the elements of the right edge and an element of the


Third: the property value for the specific pixel value, such as 30dip, 40px

Android:layout_marginBottom is an element bottom edge distance

Android:layout_marginLeft from the left edge of the distance of an element

Android:layout_marginRight is right on the edge of the distance of an element

Android:layout_marginTop from an element on the edge of the distance


EditText android:hint

Set the EditText for the input message box empty.


android:gravity 

The android:gravity attribute is defined on the view content. For example, a button above the text. you can set the text in the view on the left, to the right locations. In the case of button, android:gravity= "right" button above the text on the right


android:layout_gravity

Android:layout_gravity is used to set the view relative with parent view position. For example, a button in LinearLayout, you want to put the button on the left, to the right locations can be through the property. In the case of button, android:layout_gravity= "right" button to the right


android:layout_alignParentRight

The current control and the right end of the right end of the alignment of the parent control. Here the attribute values only for true or false, the default false.

Posted by Boris at November 18, 2013 - 9:56 AM