android--layout (linear layout linearlayout, table layout tablelayout, frame layout framelayout)

Source: Internet
Author: User

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)

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.