android-Common layout-< three >

Source: Internet
Author: User

1. Linear Layout (LinearLayout)

Layout_weight: Is the proportion of the user interface that represents the entire parent class, for example, there are two linear layouts in the same interface, and the X-linear layout gravity is 2,y linear layout specific gravity is 3.

The size of the parent interface is 2/5, and two Y accounts for the area of the parent interface 3/5

<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Fill_parent"Android:layout_height= "Fill_parent"android:orientation= "vertical" ><LinearLayoutandroid:orientation= "Horizontal"Android:layout_width= "Fill_parent"Android:layout_height= "Fill_parent"Android:layout_weight= "1">         <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:background= "#00ff00"Android:text= "00FF00"android:textsize= "15pt"         />          <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:background= "#ff0000"Android:text= "ff0000"android:textsize= "15pt"         />               <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:background= "#0000ff"Android:text= "0000FF"android:textsize= "15pt"         />               </LinearLayout><LinearLayoutandroid:orientation= "vertical"Android:layout_width= "Fill_parent"Android:layout_height= "Fill_parent"Android:layout_weight= "1">     <TextViewAndroid:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"Android:background= "#00ffff"Android:text= "00ffff"android:textsize= "15pt"         />          <TextViewAndroid:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"Android:background= "#ffff00"Android:text= "FFFF00"android:textsize= "15pt"         />               <TextViewAndroid:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"Android:background= "#ff00ff"Android:text= "FF00FF"android:textsize= "15pt"         /> </LinearLayout></LinearLayout>

2. Table layout (tablelayout)

Http://blog.sina.com.cn/s/blog_63c66eb60100u29p.html

3. Relative Layout (relativelayout)

4. Absolute layout (absolutelayout)

Layout in a coordinate manner, not recommended, unless specifically required, and its elements can overlap on top of other elements.

 

android-Common layout-< three >

Related Article

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.