Android XML Layout Daquan

Source: Internet
Author: User

First Class: Property value is True or False
Android:layout_centerhrizontal 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.
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: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.
--------------------------------------------------------------------------------------------------------------- ----------------------------------------------
Android:id
Specify the appropriate ID for the control
Android:text
Specify the text that appears in the control, and be aware that the string in the Strings.xml file is used as much as possible here
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
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 other positions can be set by this property. Take button For example, android:layout_gravity= "right" button on
Android:textsize
Specifies the size of the font in the control
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 important in view, divide space proportionally
android:padding*
Specifies the padding for the control, meaning 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 siz
Android:layout_centerhrizontal
Center horizontally
Android:layout_centervertical
Center vertically
Android:layout_centerinparent
Fully centered relative to 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.
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


--------------------------------------------------------------------------------------------------------------- --------------------------------------
Android:interpolator
There may be a lot of people don't understand its usage, the document is not very clear, in fact, very simple, see below: Interpolator defines the rate at which the change of an animation is made. This allows the basic animation effects (alpha, scale, translate, rotate) to be accelerated, slowed down, duplicated, etc. In a popular point of understanding is: the progress of the animation using Interpolator control. Interpolator defines the speed at which the animation changes, which can be achieved by constant velocity, positive acceleration, negative acceleration, irregular acceleration, and so on. Interpolator is a base class that encapsulates all interpolator common methods, and it has only one method, the getinterpolation (float input), which maps a point on the timeline to a M Ultiplier to is applied to the transformations of an animation. Android provides several interpolator subclasses that implement different speed curves, as follows:
Acceleratedecelerateinterpolator at the beginning of the animation and the introduction of the local rate change is slow, in the middle of the time to accelerate
Accelerateinterpolator at the beginning of the animation the rate change is slow, and then start to accelerate
Cycleinterpolator Animation Loop plays a specific number of times, rate changes along the sine curve
Decelerateinterpolator at the beginning of the animation the rate change is slow, and then start slowing down
Linearinterpolator changes at an even rate in the animation
For Linearinterpolator, the rate of change is a constant, i.e. f (x) = x.
public float getinterpolation (float input) {
return input;
}
Interpolator other sub-classes, are also in accordance with the specific algorithm, the realization of the rate of change. You can also define your own interpolator subclass to achieve the physical effects of parabolic and freefall.

Android XML Layout Daquan

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.