MainActivity.java(默认的,什么都没有)

package com.sxt.day02_02;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu; public class MainActivity extends Activity { @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
} @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
} }

xml文件:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" > <TableLayout 2行2列,用户名密码
android:layout_width="match_parent" 宽:占满一行
android:layout_height="wrap_content" 高:
android:stretchColumns="1" > 从0开始,1就是第二列,第一列内容有多宽就多宽,第二列把剩余全部占据 <TableRow> 第一行 <TextView android:text="用户名" />第一列。不设置宽和高,则根据文字大小来定。 <EditText android:hint="2-10个字符" />第一列,
</TableRow> <TableRow> <TextView android:text="密码" /> <EditText
android:hint="2-10个字符"
android:password="true" />
</TableRow>
</TableLayout> <TableLayout 1行2列,登陆退出
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stretchColumns="0,1" > 这2列都是自动扩展,平分当前行, <TableRow> <Button
android:background="@drawable/btn_bg"
android:drawableLeft="@drawable/login32x32" 左图右字
android:padding="3dp" 内部间距
android:text="登陆"
android:textColor="#fff"
android:layout_gravity="center_horizontal"/> 水平居中 <Button
android:background="@drawable/btn_bg"
android:drawableLeft="@drawable/exit32x32"
android:padding="3dp"
android:text="退出"
android:textColor="#fff" 文字颜色,白色
android:layout_gravity="center_horizontal"/> 水平居中
</TableRow>
</TableLayout> </LinearLayout>

android 03 TableLayout的更多相关文章

  1. Android开发--TableLayout的应用

    1.简介 TableLayout为表格框架结构

  2. android:TableLayout表格布局详解

    1.TableLayout简介2.TableLayout行列数的确定3.TableLayout可设置的属性详解4.一个包含4个TableLayout布局的实例及效果图一.Tablelayout简介  ...

  3. Android 使用 TableLayout 布局拉伸宽度

    转自:http://www.cnblogs.com/ghj1976/archive/2011/04/21/2023850.html 布局文件 <?xml version="1.0&qu ...

  4. android布局##TableLayout和FrameLayout-android学习之旅(十五)

    TableLayout 表格布局 tablelayout简介 表格布局有TableLayout代表,但是它的本质定义仍然是线性管理器.表格布局采用行和列来管理UI,但是不需要明确的定义多少行,多少列, ...

  5. Android Layout: TableLayout

    TableLayout<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" andr ...

  6. Android之TableLayout表格布局

    1.相关属性 1.1.常用属性 android:collapseColumns 设置需要被隐藏的列的序列号 android:shrinkColumns 设置允许被收缩的列的序列号 android:st ...

  7. Android 之 TableLayout 布局详解

    TableLayout简介 •简介 Tablelayout 类以行和列的形式对控件进行管理,每一行为一个 TableRow 对象,或一个 View 控件. 当为 TableRow 对象时,可在 Tab ...

  8. Android布局-TableLayout表格布局

    一.表格布局-TableLayout 1.概念 表格布局采用行列的形式来管理UI的控件.表格布局适合于有规则的布局. TableRow,用来管理行,TableRow中的一个空间占据该行的一列.若不用T ...

  9. UI篇--Android中TableLayout中的布局

        表格布局是按照行列来组织子视图的布局.表格布局包含一系列的Tablerow对象,用于定义行(也可以使用其它子对象).表格布局不为它的行.列和单元格显示表格线.每个行可以包含个以上(包括)的单元 ...

随机推荐

  1. mssql 获取表结构信息

    SELECT (case when a.colorder=1 then d.name else null end) 表名, a.colorder 字段序号,a.name 字段名, (case when ...

  2. win7下配置IIS服务器方法

    网站爱好初学者必看的win7系统配置自己的IIS,可以在你自己的电脑上配置网站服务器发不到网上,下面就跟着我的步骤一起做吧100%成功. 步骤方法 1.点击开始-------控制面板这个就是打开的控制 ...

  3. Linux Kernel Makefile Test

    一.本文说明 本文为linux内核Makefile整体分析的续篇,是依据Linux内核Makefile体系的主要内容编写一个简要的测试工程.Linux内核Makefile体系就好像一只“大鸟”,而这篇 ...

  4. VS2012编译生成XP可以执行的程序

    首先需要的就是下载VS2012的Update 4更新包,然后打开项目的属性页,在 配置属性->平台工具集 选项中选择 Visual Studio 2012 - Windows XP (v110_ ...

  5. FTP原理和cent OS vsFTPd架设

    1.ftp为明码传输 2.客户端和服务端采用两条链路来分别进行命令和数据的传输.数据传输的模式分为主动链接和被动链接. 3.客户端在需要数据的时候,会告知服务器端采取主动或者被动的方式来链接. 4.如 ...

  6. BZOJ 3595: [Scoi2014]方伯伯的Oj SBT+可持久化Treap

    3595: [Scoi2014]方伯伯的Oj Time Limit: 6 Sec  Memory Limit: 256 MBSubmit: 102  Solved: 54[Submit][Status ...

  7. StringGrid右击选中表格(发消息给句柄模拟点击,右键点击也是MouseDown)

    顺便还把单元格给变了: procedure TFGLGL.StringGrid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShi ...

  8. Java接口修饰符详解

    接口就是提供一种统一的”协议”,而接口中的属性也属于“协议”中的成员.它们是公共的,静态的,最终的常量.相当于全局常量.抽象类是不“完全”的类,相当于是接口和具体类的一个中间层.即满足接口的抽象,也满 ...

  9. 在eclipse中安装activiti插件

    最近在学习activiti,先学习安装插件吧. 单击help->Install new Software 然后添加资源 name:activiti location:http://activit ...

  10. 【转】Android Fragment 基本介绍--不错

    原文网址:http://www.cnblogs.com/mengdd/archive/2013/01/08/2851368.html Fragment Android是在Android 3.0 (AP ...