zoukankan      html  css  js  c++  java
  • LinearLayout布局

    布局代码

    <?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"
        >
        <TextView
            android:text="第一行"
            android:gravity="center_vertical"
            android:textSize="15pt"
            android:background="#aa0000"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"/>
        
        <TextView
            android:text="第二行"
            android:textSize="15pt"
            android:gravity="center_vertical"
            android:background="#00aa00"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"/>
        
        <TextView
            android:text="第三行"
            android:textSize="15pt"
            android:gravity="center_vertical"
            android:background="#0000aa"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"/>
        <TextView
            android:text="第四行"
            android:textSize="15pt"
            android:gravity="center_vertical"
            android:background="#aaaa00"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"/>
    
    </LinearLayout>

     

    布局文件

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
        <TextView
            android:text="第一列"
            android:gravity="center_horizontal"
            android:background="#aa0000"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"/>
        
        <TextView
            android:text="第二列"
            android:gravity="center_horizontal"
            android:background="#00aa00"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"/>
        
        <TextView
            android:text="第三列"
            android:gravity="center_horizontal"
            android:background="#0000aa"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"/>
        
        <TextView
            android:text="第四列"
            android:gravity="center_horizontal"
            android:background="#aaaa00"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"/>
    </LinearLayout>
  • 相关阅读:
    BaseServlet的编写
    两个线程交替打印1-100
    java集合中的HashMap源码分析
    mybatis一级缓存与二级缓存的原理
    mybatis的执行流程
    spring IOC的理解
    一文彻底搞懂面试中常问的各种“锁”
    Dubbo相关的基础
    Servlet基础
    文件传输基础
  • 原文地址:https://www.cnblogs.com/spadd/p/4189818.html
Copyright © 2011-2022 走看看