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>
  • 相关阅读:
    高精度“+”算法
    漏洞扫描
    端口扫描
    使用sqlmap
    Kali实现靶机远程控制
    Docker下配置KeepAlive支持nginx高可用
    web攻防环境--一句话木马
    Docker容器技术--自定义网桥后的默认网卡名称
    小白大数据学习指南
    Nginx简单操作
  • 原文地址:https://www.cnblogs.com/spadd/p/4189818.html
Copyright © 2011-2022 走看看