"Android" top five layout Common properties

Source: Internet
Author: User

linear Layout (linearlayout)
Common Properties:
android:orientation= "Vertical"-determines how the sub-class controls are arranged (vertical vertical; horizontal level)
android:garavity= "Center"--determines the position of the child control's XY
common property values:
1>center_vertical: Vertical (Y axis) centered
2>center_horizongtal: Horizontal Center
3>center Center
4>right on the right side of the current layout
5>left left
6>bottom The bottom of the current layout
Note : Android:gravity supports a variety of properties, but multiple attribute values are separated by a vertical bar, but no spaces can appear before or after the vertical bar!   
sub-class properties:
android:layout_gravity= "Bottom"-the position of the control in the parent container
android:layout_weight = "1"--the ratio of the control to the parent container
relative layout (relativelayout) relative to other sibling controls or parent class containers
Common Properties:
android:gravity= ""--sets the alignment of the sub-components within the layout container
android:ignoregravity= "" set that component to be unaffected by gravity
sub-class properties:
First Class: property value is True or false
Android:layout_centerhorizontal 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.
Second class: The attribute value must be the reference name of the ID
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
Class III: Attribute values are specific pixel values, such as 30dip,40px
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
EditText The Android:hint setting EditText is empty when the message is in the input box.
The android:gravity property is the qualification for the view content. For example, a button above the text. You can set the text to be left on the view, right, and so on.

Properties that are not commonly used by subclasses:

Android:scaletype is to control how the picture resized/moved to match the imageviewsize.
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.
   Note: The name of the image in the Drawable folder cannot be capitalized.
table Layout (tablelayout)
Common Properties:
Android:stretchcolumns= ""--sets the columns that can be stretched. The column can stretch to the row direction, up to a full row.
Android:shrinkcolumns= ""--sets the columns that can be shrunk. When the column control has too much content and is already packed with rows, the content is displayed in the row direction.
Android:collapsecolumns= ""--sets the column to hide.
sub-class properties:
Android:layout_column= ""--Specifies that the cell is displayed in the first column
Android:layout_span= ""--Specifies the number of columns that the cell occupies (1 if unspecified)
frame Layout (framelayout)
Common Properties:
Android:foreground= ""--sets the foreground image of the layout container
Android:foregroundgravity= "" Sets the gravity property of the drawing foreground graph
Absolute Layout (absolutelayout) can also be called coordinate layout

Common Properties:
Android:layout_x= ""--Specifies the X-coordinate of the sub-space
Android:layout_y= ""--Specifies the Y-coordinate of the child control

"Android" top five layout Common 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.