• android学习笔记04(LinearLayout的嵌套)


    java类:

    package tk.layout_04;
    
    import android.os.Bundle; 
    import android.app.Activity; 
    import android.view.Menu;
    
    public class Layout04 extends Activity {
    
        @Override 
        public void onCreate(Bundle savedInstanceState) { 
            super.onCreate(savedInstanceState); 
            setContentView(R.layout.layout04); 
        }
    
        @Override 
        public boolean onCreateOptionsMenu(Menu menu) { 
            getMenuInflater().inflate(R.menu.layout04, menu); 
            return true; 
        } 
    }

    XML文件:

    <?xml version= "1.0" encoding ="utf-8"?> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        android:orientation= "vertical" 
        android:layout_width= "fill_parent" 
        android:layout_height= "fill_parent" 
        > 
        <LinearLayout 
            android:orientation= "horizontal" 
            android:layout_width= "fill_parent" 
            android:layout_height= "fill_parent" 
            android:layout_weight="1" 
            > 
            <TextView 
                android:text="red" 
                android:gravity="center_vertical" 
                android:background="#aa0000" 
                android:layout_width="wrap_content" 
                android:layout_height="fill_parent" 
                android:layout_weight="1" 
                /> 
            <TextView 
                android:text="green" 
                android:gravity="center_vertical" 
                android:background="#00aa00" 
                android:layout_width="wrap_content" 
                android:layout_height="fill_parent" 
                android:layout_weight="1" 
                /> 
            <TextView 
                android:text="blue" 
                android:gravity="center_vertical" 
                android:background="#0000aa" 
                android:layout_width="wrap_content" 
                android:layout_height="fill_parent" 
                android:layout_weight="1" 
                /> 
                        
        </LinearLayout> 
        <LinearLayout 
            android:orientation= "vertical" 
            android:layout_width= "fill_parent" 
            android:layout_height= "fill_parent" 
            android:layout_weight="1" 
            >
    
            <TableLayout 
                xmlns:android="http://schemas.android.com/apk/res/android" 
                android:layout_width= "fill_parent" 
                android:layout_height= "fill_parent" 
                android:stretchColumns="0" 
                > 
            
                    <TableRow > 
                    <TextView 
                        android:text="@string/row1_col1" 
                        android:background="#aaaa00" 
                        android:padding="3dip" 
                        /> 
                     <TextView 
                        android:text="@string/row1_col2" 
                        android:background="#00aa00" 
                        android:gravity="right" 
                        android:padding="3dip" 
                        /> 
                     <TextView 
                        android:text="@string/row1_col3" 
                        android:background="#0000aa" 
                        android:gravity="right" 
                        android:padding="3dip" 
                        /> 
                     
            
                 </TableRow> 
                   <TableRow >     
                    <TextView 
                        android:text="@string/row2_col1" 
                        android:padding="3dip" 
                        /> 
                     <TextView 
                        android:text="@string/row2_col2" 
                        android:gravity="right" 
                        android:padding="3dip" 
                        /> 
                    
            
                 </TableRow> 
                
            
            </TableLayout>
    
                        
        </LinearLayout> 
        
    </LinearLayout>
  • 相关阅读:
    吴恩达读书笔记【5】-流水线与端到端
    标准与扩展ACL 、 命名ACL
    VLAN间通讯 、 动态路由RIP
    HSRP热备份路由协议 、 STP生成树协议
    VLAN广播域划分
    应用层
    包格式及IP地址 、 网络层协议及设备
    传输层 、 应用层
    数据链路层解析 、 交换机基本配置
    网络基础3
  • 原文地址:https://www.cnblogs.com/tiankonguse/p/2610787.html
Copyright © 2020-2023  润新知