Android Control Layout Common Properties

Source: Internet
Author: User
<span id="Label3"></p><p><p><!--a single control is often used<br>Android:id--specify the appropriate ID for the control<br>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.<br>Android:grivity--the base position of the specified control, such as center, right, etc position<br>Android:textsize--specifies the size of the font in the control<br>Android:background--specifies the background color used by the control, and the RGB naming method<br>Android:width--the width of the specified control<br>Android:height--the height of the specified control<br>Android:padding*--specifies the padding for the control, meaning that the contents of the control<br>Android:sigleline--if set to true, the contents of the control are displayed in the same profession<br>-</p></p><p><p></p></p><p><p><!--is often used relative to layout<br>Android:layout_above the bottom of the control to the control of the given ID<br>Android:layout_below the top of the control to the control of the given ID<br>Android:layout_toleftof aligns the right edge of the control with the left edge of the control for the given ID<br>Android:layout_torightof aligns the left edge of the control with the right edge of the control for the given ID</p></p><p><p>Android:layout_alignbaseline the baseline of the Control's baseline and the given ID of the control<br>Android:layout_alignbottom aligns the bottom edge of the control with the bottom edge of the given ID control<br>Android:layout_alignleft aligns the left edge of the control with the left edge of the given ID control<br>Android:layout_alignright aligns the right edge of the control with the right edge of the given ID control<br>Android:layout_aligntop aligns the top edge of the given control with the top of the given ID control</p></p><p><p><br>Android:alignparentbottom If the value is true, align the bottom of the control with the bottom of the parent control<br>Android:layout_alignparentleft If the value is true, align the left side of the control with the left side of the parent control<br>Android:layout_alignparentright If the value is true, align the right side of the control with the right side of the parent control<br>Android:layout_alignparenttop If the value is true, aligns the top of the space with the top of the parent control</p></p><p><p>Android:layout_centerhorizontal If the value is true, the control will be in the horizontal direction of the central<br>Android:layout_centerinparent If the value is true, the control will be centered on the horizontal and vertical direction of the parent control<br>Android:layout_centervertical If the value is true, the control will be in the vertical direction of the central <span style="font-size: 15px;"><br>-</span></p></p><p><p></p></p><p><p>Extended Knowledge:</p></p><p><p><span style="font-size: 15px;"><strong>Edittext's Android:hint</strong></span></p></p><p><p><span style="font-size: 15px;">Sets the prompt information in the input box when EditText is Empty.</span></p></p><p><p><span style="font-size: 15px;"><strong>android:gravity</strong><br><span style="font-size: 15px;">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</span></span></p></p><p><p><span style="font-size: 15px;"><strong>android:layout_gravity</strong><br><span style="font-size: 15px;">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<br><span style="font-size: 15px;"><strong><br>Android:layout_alignparentright</strong><br><span style="font-size: 15px;">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.</span></span></span></span></p></p><p><p><span style="font-size: 15px;"><strong>android:scaletype:</strong><br><span style="font-size: 15px;">Android:scaletype is a size that controls how the picture resized/moved to the IMAGEVIEW. The meaning difference of imageview.scaletype/android:scaletype value:</span></span></p></p><p><p><span style="font-size: 15px;">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</span></p></p><p><p><span style="font-size: 15px;">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</span></p></p><p><p><span style="font-size: 15px;">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</span></p></p><p><p><span style="font-size: 15px;">Fit_center/fitcenter Enlarge/shrink the picture to the width of the view, centered on the display</span></p></p><p><p><span style="font-size: 15px;">Fit_end/fitend Zoom in/out to the width of the view, displayed in the lower part of the view</span></p></p><p><p><span style="font-size: 15px;">Fit_start/fitstart Enlarge/shrink the image to the width of the view, displayed in the upper part of the view</span></p></p><p><p><span style="font-size: 15px;">Fit_xy/fitxy The picture is not scaled up/down to the view size display</span></p></p><p><p><span style="font-size: 15px;">The Matrix/matrix is drawn with a matrix and is displayed by zooming in and out of the Image.</span></p></p><p><p><span style="font-size: 15px;">Note that the name of the image in the Drawable folder cannot be Capitalized.</span></p></p><p><p>Android Control Layout Common Properties</p></p></span>

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.