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>
  • 相关阅读:
    Map根据key或者value排序
    docker部署Javaweb项目(jdk+tomcat+mysql)
    MySQL设置某一字段默认为0,但是插入数据化却显示为null
    文件下载
    JXLS导出Excel(模板导出)
    eclipse使用lombok
    Integer 类型数值判断相等的坑
    通用Mapper相关
    SSM配置Socket多线程编程(RFID签到实例)
    使用JSONObject遇到的问题,java.lang.NoClassDefFoundError: net/sf/json/JSONObject
  • 原文地址:https://www.cnblogs.com/spadd/p/4189818.html
Copyright © 2011-2022 走看看