Linear layout:
<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns: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= "Com.example.chenshuai.test322.MainActivity"android:orientation= "vertical"android:gravity= "Center_horizontal" > <LinearLayoutAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"android:padding= "16DP"> <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "User name:" /> <EditTextAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:hint= "Please enter user name"/><!--Default Value - </LinearLayout> <LinearLayoutAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"android:padding= "16DP"> <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Password:" /> <EditTextAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:hint= "Please enter password"Android:password= "true"/><!--Password Entry box - </LinearLayout> <LinearLayoutAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"android:gravity= "Center_horizontal"> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Login"Android:layout_weight= "1"/><!--Weights - <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Register"Android:id= "@+id/button2"Android:layout_weight= "1"/> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Cancel"Android:layout_weight= "1"/> </LinearLayout></LinearLayout>
Table layout
<?XML version= "1.0" encoding= "Utf-8"?><Tablelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"Android:stretchcolumns= "Up"> <TableRow> <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "User name:" /> <EditTextAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_span= "2"/> </TableRow> <TableRow> <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Password:" /> <EditTextAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:password= "true"Android:layout_span= "2"/> </TableRow> <TableRow> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Login"Android:layout_weight= "1"/> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Register"Android:id= "@+id/button2"Android:layout_weight= "1"/> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Cancel"Android:layout_weight= "1"/> </TableRow></Tablelayout>
Frame layout
<?XML version= "1.0" encoding= "Utf-8"?><Framelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"> <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:width= "320DP"Android:height= "320DP"android:layout_gravity= "Center"Android:background= "#f00"/><!--Red - <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:width= "280DP"Android:height= "280DP"android:layout_gravity= "Center"Android:background= "#0f0"/><!--Green - <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:width= "240DP"Android:height= "240DP"android:layout_gravity= "Center"Android:background= "#00f"/><!--Blue - <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:width= "200DP"Android:height= "200DP"android:layout_gravity= "Center"Android:background= "#ff0"/><!--Yellow - <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:width= "160DP"Android:height= "160DP"android:layout_gravity= "Center"Android:background= "#f0f"/><!--Purple -</Framelayout>
android--layout (linear layout linearlayout, table layout tablelayout, frame layout framelayout)