Android Layout Relativelayout Properties 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 "@id/id-name"

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 '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 in the View On the left, on the right and other positions. Take button For example,android:gravity= "right" button The text above is on the right

Android:layout_gravity

Android:layout_gravity view relative to the parent VIEW  BUTTON  in Span style= "Font-family:times New Roman" >linearlayout you want to put that button placed on the left, right and so on can be set by this property. With button Span style= "Font-family:times New Roman" >android:layout_gravity= "right" button right  

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 picture , when the picture is longer / wider than the View The Center portion of the image is displayed

Center_crop / centercrop  size center display, making the picture long ( " equals or greater than View long width

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 length / width of 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 enlarges / shrinks the image to the width of the view, displayed in the view The upper part of the position

Fit_xy/fitxy enlarge / shrink the picture to View The size of the display

the Matrix/matrix is drawn with a matrix and is displayed by zooming in and out of the image.

* Note that the name of the image in the Drawable folder cannot be capitalized.

Android Layout Relativelayout Properties 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.