<!-- 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