Android base top3:activity linear, relative, frame and table layout generalization

Source: Internet
Author: User

Linear layout LinearLayout:

<linearlayout xmlns: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"android:orientation= "Vertical"Tools:context= "Com.example.top3.MainActivity" > <EditText android:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"Android:hint= "Please enter registered user name"/> <requestfocus/> <EditText android:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"Android:hint= "Please enter password"/> <EditText android:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"Android:ems= "5"Android:hint= "Please enter password again" > </EditText> <EditText android:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"Android:hint= "Please enter Mailbox"/> <Button android:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"Android:layout_margin= "10dip"Android:background= "@drawable/btn_bg"android:gravity= "Center"Android:hint= "Register"/></linearlayout>

Relative layout relativelayout:

1<?xml version= "1.0" encoding= "Utf-8"?>2<Relativelayout3Xmlns:android= "Http://schemas.android.com/apk/res/android"4Android:layout_width= "Match_parent"5android:layout_height= "Match_parent"6>7     8<EditText9Android:id= "@+id/e1"TenAndroid:layout_width= "Fill_parent" Oneandroid:layout_height= "Wrap_content" AAndroid:hint= "Please enter user name" -/> -<EditText theAndroid:id= "@+id/e2" -android:layout_below= "@id/e1" -Android:layout_width= "Fill_parent" -android:layout_height= "Wrap_content" +Android:hint= "Please enter user name"/> -  +<Button AAndroid:id= "@+id/b2" atandroid:layout_below= "@id/e2" -android:layout_alignright= "@id/e2" -Android:layout_width= "Wrap_content" -android:layout_height= "Wrap_content" -android:text= "Register" -/> in<Button -Android:id= "@+id/b1" toandroid:layout_below= "@id/e2" +android:layout_toleftof= "@id/b2" -Android:layout_width= "Wrap_content" theandroid:layout_height= "Wrap_content" *android:text= "Login" $/>Panax Notoginseng  -</RelativeLayout>

Frame Layout Framelyaout:

<?xml version= "1.0" encoding= "Utf-8"? ><framelayout xmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Fill_parent"Android:layout_height= "Fill_parent" > <TextView Android:id= "@+id/t1"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:background= "#f00"Android:height= "300DP"Android:width= "300DP"/> <TextView android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:background= "#0f0"Android:height= "100DP"Android:width= "150DP"/> <TextView android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:background= "#00f"Android:height= "50DP"Android:width= "100DP"/></framelayout>

Table Layout tablelayout:

<?xml version= "1.0" encoding= "Utf-8"? ><tablelayout xmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "vertical" > <tablerow > <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Name"Android:paddingleft= "20DP"android:textsize= "16DP"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "20DP"android:textsize= "16DP"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "20DP"android:textsize= "16DP"/></tablerow><tablerow> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "15DP"android:textsize= "8DP"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "40DP"android:textsize= "8DP"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "40DP"android:textsize= "8DP"/> </TableRow><TableRow> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "15DP"android:textsize= "8DP"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "40DP"android:textsize= "8DP"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "40DP"android:textsize= "8DP"/> </TableRow><TableRow> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "15DP"android:textsize= "8DP"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "40DP"android:textsize= "8DP"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "40DP"android:textsize= "8DP"/> </TableRow><TableRow> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "15DP"android:textsize= "8DP"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "40DP"android:textsize= "8DP"/> <TextView android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:layout_weight= "1"Android:text= "Achievement"Android:paddingleft= "40DP"android:textsize= "8DP"/> </TableRow></TableLayout>

Android base top3:activity linear, relative, frame and table layout generalization

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.