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>
  • 相关阅读:
    Buffer lock
    union all合并记录
    欢迎您在新浪博客安家
    热点块引发的cache buffers cahins latch
    linux下能ping ip不能ping域名详解
    简易计算器页面
    学生管理系统报错(一)
    低效的SQL引发的cache buffers chains latch
    常用监控SQL
    C/C++ XMPP/Jabber 客户端类库对比/点评
  • 原文地址:https://www.cnblogs.com/spadd/p/4189818.html
Copyright © 2011-2022 走看看