Common attribute descriptions for XML layouts in Android development

Source: Internet
Author: User

<!--     Common Property Description:     android:id= "@+id/button"  specifies the ID for the control     android:text= "nnnnnnnnnn" Specifies the display text for the control     android: Textsize= "12pt"   to let the text in the control display size     android:singleline= "True"  allows the text displayed in the control to be displayed on one line, and automatically omit Android if it is not displayed     : Gravity= "left"   lets the contents of the control display     android:padding= "16DP" so that the text in the control is within the padding size of the outer border of the control, which can be like padding_left in CSS ...     android:background= the  background color in the #ff0000 control     android:width= "1060dip" specifies the width of the control, as if it does not work     android:height= " 200dip "Specifies the height of the control, as     if the android:layout_width=" 200DP "  control layout width, if it is fill_parent indicates that the level fills the parent control with     android: Layout_height= "Wrap_content" fills the height; fill_parent means filling up the parent control, preferably not.     android:layout_weight= "1" represents the layout weight with the sibling control, if two are 1 that is one half, the number of large occupy more    space  -
<Relativelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Xmlns:tools= "Http://schemas.android.com/tools"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"Tools:context=". Mainactivity ">    <LinearLayoutandroid:orientation= "vertical"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"Android:layout_alignparentleft= "true"Android:layout_alignparentstart= "true">        <ButtonAndroid:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"Android:text= "NNN"Android:width= "160DP"Android:height= "200DP"Android:background= "#ff0000"android:textsize= "12pt"android:gravity= "Right"android:padding= "16DP"Android:singleline= "true"Android:layout_weight= "1"Android:id= "@+id/button" />        <!--android:singleline= "True" indicates a single line display with an endless ellipsis -        <ButtonAndroid:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"Android:text= "New button"Android:id= "@+id/button4"android:layout_gravity= "Right"Android:layout_weight= "2" />    </LinearLayout></Relativelayout>

Common attribute descriptions for XML layouts in Android development

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.