XML code
- <!--
- framelayout--can have only one control, and cannot design the position of the control, the control will be placed in the upper left corner
- You can put multiple controls inside a linearlayout--, but only one control on a line
- tablelayout--this to be used in conjunction with TableRow, much like the table in HTML
- You can put multiple controls inside the absolutelayout--, and you can define the location of the control's X, y
- You can put more than one control inside a relativelayout--, but the position of the control is relative to the position
- (The layout of the interface seems to have a direct reference to some view, such as ScrollView, etc.)
XML code
- android:orientation--it determines the direction of the LinearLayout, whose value can be *vertical, which represents the vertical layout *horizontal, which represents the horizontal layout
XML code
- android:layout_width--refers to the width of the current control in the parent control, you can set its determined value, but generally use the following two values *fill_parent, filling the parent control with a blank *wrap_content, indicating that the size is just enough to display the contents of the current control
XML code
- android:layout_height--indicates the height of the current control in the parent control and can set its determined value, but generally uses the following two values *fill_parent to fill the parent control's blank *wrap_content. Indicates that the size is just enough to display the contents of the current control
XML code
- android:id--specify the appropriate ID for the control
XML code
- 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.
XML code
- android:grivity--Specifies the base position of the control, such as centering, right, etc. If the view setting is not a child control, this property represents the alignment of the content, or if the view setting for the child control is set for this property, it indicates the alignment of the child control (gravity inclination), when the value requires more than one, with the "|" Separate
XML code
- android:textsize--Specifies the size of the font in the control
XML code
- The android:background--specifies the background color used by the control, and the RGB naming method. If you set a transparent background picture button android:background="@android: color/transparent"
XML code
- android:width--the width of the specified control
XML code
- android:height--the height of the specified control
XML code
- android:padding*--Specifies the padding for the control, meaning that the contents of the control
XML code
- android:sigleline--if set to True, the contents of the control are displayed in the same profession
XML code
- android:src--referencing a resource, for example: Applying another XML,android:src="@drawable/imageselector"
XML code
- The android:layout_alignbottom--property is used to align with the bottom of a control. Example : android:layout_alignbottom="@id/tvfilepath"
XML code
- The android:layout_marginright--property sets the Edge blank, with the top and bottom left and right points. Example : android:layout_marginright="3dip"
XML code
- The Android:layout_gravity property sets the position of the control at the parent control. Example : android:layout_gravity="center_vertical"
XML code
-
- First Class: property value is true or false
- android:layout_centerhorizontal -- If the value is true, the control will be centered horizontally (horizontally)
- android:layout_centervertical -- if the value is true, the control is in the vertical center (vertically centered);
- Android:layout_ centerinparent -- if the value is true, the control will be centered in the horizontal and vertical direction of the parent control (relative to the parent element )
-
- android:layout_alignparentbottom -- If the value is true, align the bottom of the control with the bottom of the parent control (snapping to the lower edge of the parent element)
- android:layout_alignparentleft -- If the value is true, align the left side of the control with the left side of the parent control (snapping to the left edge of the parent element)
- android:layout_alignparentright -- If the value is true, align the right side of the control with the right side of the parent control (snapping to the right edge of the parent element)
- android:layout_alignparenttop -- If the value is true, aligns the top of the space with the top of the parent control (snapping to the upper edge of the parent element)
- android:layout_alignwithparentifmissing -- The parent element if the corresponding sibling element is not found
XML code
- Second class: The attribute value must be the reference name of the id "@id/id-name"
- android:layout_above--the bottom of the control to the control of the given ID (above the element)
- android:layout_below--the top of the control to the control of the given ID (below the element)
- android:layout_toleftof--aligns the right edge of the control with the left edge of the control for the given ID (on the left side of an element)
- android:layout_torightof--aligns the left edge of the control with the right edge of the control for the given ID (on the left side of an element)
- android:layout_aligntop--aligns the top edge of the given control with the top of the given ID control (the upper edge of this element and the upper edge of an element are aligned)
- android:layout_alignbottom--aligns the bottom edge of the control with the bottom edge of the given ID control (the lower edge of this element and the bottom edge of an element)
- android:layout_alignleft--aligns the left edge of the control with the left edge of the given ID control (aligns the left edge of this element with the left edge of an element)
- android:layout_alignright--aligns the right edge of the control with the right edge of the given ID control (the right edge of this element and the right edge of an element)
- android:layout_alignbaseline--the baseline of the control's baseline and the given ID of the control
XML code
- EditText's Android:hint
- Sets the prompt information in the input box when EditText is empty.
- Android:gravity
- The Android:gravity property is the qualification for the view content. For example, a button above the text. You can set the text on the left side of the view, on the right, and so on. Take the button as an example,android:gravity="Right" then the text on the button
- Android:layout_gravity
- Android:layout_gravity is used to set the position of the view relative to the parent view. 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:layout_alignparentright
- Aligns the right end of the current control with the right end of the parent control. This property value can only be true or FALSE, which is false by default.
- Android:scaletype:
- Android:scaletype is a size that controls how the picture resized/moved to the ImageView. The meaning difference of Imageview.scaletype/android:scaletype value:
- Center/center is centered on the original size of the image, and when the picture is longer/wider than the length/width of the view, the center portion of the image is displayed
- Center_crop/centercrop proportionally enlarges the size of the image so that the image is long (wide) equal to or greater than the length (width) of the view
- Center_inside/centerinside Displays the contents of the picture in full, by scaling it down or the original size to make the picture long/wide equal to or less than the length/width of the view
- Fit_center/fitcenter enlarge/Shrink the picture to the width of the view, centered on the display
- Fit_end/fitend Zoom in/out to the width of the view, displayed in the lower part of the view
- Fit_start/fitstart enlarge/Shrink the image to the width of the view, displayed in the upper part of the view
- Fit_xy/fitxy The picture is not scaled up/down to the view size display
- The Matrix/matrix is drawn with a matrix and is displayed by zooming in and out of the image.
- * * To note that the Drawable folder inside the image name can not be capitalized
- -->
Reference: http://panshengneng.iteye.com/blog/1187928
http://blog.csdn.net/achellies/article/details/6873679
Android Control Properties Daquan