• Android学习笔记——MixLayout


    该工程的功能是实现LinearLayout+TableLayout

    以下代码是MainActivity.java中的代码

    package com.example.mixlayout;
    
    import android.app.Activity;
    import android.os.Bundle;
    import android.view.Menu;
    import android.view.MenuItem;
    import android.widget.TextView;
    
    public class MainActivity extends Activity {
    
        private TextView firstText; 
        
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
        }
    }

    以下代码是activity_main.xml中的代码

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/LinearLayout1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        tools:context="${relativePackage}.${activityClass}" >
    
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:orientation="horizontal" >
    
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:background="#aa0000"
                android:gravity="center_horizontal"
                android:text="red" />
    
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:background="#00aa00"
                android:gravity="center_horizontal"
                android:text="green" />
    
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:background="#0000aa"
                android:gravity="center_horizontal"
                android:text="blue" />
        </LinearLayout>
    
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:orientation="horizontal" >
    
            <TableLayout 
                xmlns:android="http://schemas.android.com/apk/res/android" 
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:stretchColumns="1">
                <TableRow>
    
                    <TextView
                        android:padding="3dip"
                        android:text="row1_column1" />
    
                    <TextView
                        android:gravity="center_horizontal"
                        android:padding="3dip"
                        android:text="row1_column2" />
    
                    <TextView
                        android:gravity="right"
                        android:padding="3dip"
                        android:text="row1_column3" />
                </TableRow>
    
                <TableRow>
    
                    <TextView
                        android:padding="3dip"
                        android:text="row2_column1" />
    
                    <TextView
                        android:gravity="center_horizontal"
                        android:padding="3dip"
                        android:text="row2_column2" />
    
                    <TextView
                        android:gravity="right"
                        android:padding="3dip"
                        android:text="row2_column3" />
                </TableRow>
            </TableLayout>
        </LinearLayout>
    
    </LinearLayout>
  • 相关阅读:
    07_zookeeper的客户端工具curator_基本api
    06_zookeeper原生Java API使用
    05_zookeeper的ACL
    04_zookeeper的watcher机制
    03_Zookeeper基本数据模型及基本命令操作
    02_zookeeper配置
    01_Zookeeper简述
    thinkphp之url的seo优化
    thinkphp Upload上传文件在客户端生成的临时文件$_FILES['file']['tmp_name']
    php过滤表单输入的emoji表情
  • 原文地址:https://www.cnblogs.com/tonglin0325/p/4584170.html
Copyright © 2020-2023  润新知