android 布局 LinearLayout

来源:互联网 发布:云计算对生活的影响 编辑:程序博客网 时间:2024/06/05 23:54

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    
    <LinearLayout 
        android:layout_width="match_parent"
    android:layout_height="wrap_content"
        android:orientation="horizontal"
        >
    <TextView
        android:layout_width="0dp"
        android:layout_height="83dp"
        android:layout_weight="1"
        android:background="#ccc"
android:gravity="top|left"
        android:text="linear btn1"
        />
    <TextView
        android:layout_width="0dp"
        android:layout_height="83dp"
        android:layout_weight="1"
        android:background="#bbb"
android:gravity="top|left"
        android:text="linear btn2"
        />


    <TextView
        android:layout_width="0dp"
        android:layout_height="83dp"
        android:layout_weight="1"
android:background="#aaa"
android:gravity="top|left"
        android:text="linear btn3" 
        />
        
    </LinearLayout>
    
    <LinearLayout 
        android:layout_width="match_parent"
  android:layout_height="match_parent"
        android:orientation="horizontal"
        >
   <LinearLayout
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:layout_weight="5"
       android:orientation="vertical" >

       <TextView
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
android:layout_weight="2"
android:background="#aaa"
android:gravity="top|left"
       android:text="linear btn4"
        />
   <TextView 
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
android:layout_weight="2"
  android:background="#bbb"
android:gravity="top|left"
       android:text="linear btn5"
       />
   <TextView
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
android:layout_weight="2" 
android:background="#ccc"
android:gravity="top|left"
       android:text="linear btn6"
       />
   </LinearLayout>
    <TextView 
       android:layout_width="match_parent"
       android:layout_height="match_parent"
android:layout_weight="3"
       android:text="linear btn7"
       />
    </LinearLayout>
    
</LinearLayout>

0 0
原创粉丝点击