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. 关于script,first,second,third=argv运行出错的问题

    from sys import argv input(argv) #python自带的IDLE直接执行不能提供命令行参数 script,first,second,third=argv print(&q ...

  2. Hyper Prefix Sets

    uva11488:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&am ...

  3. 转-[Python 学习]2.5版yield之学习心得

    在 shhgs 发布了关于< Py 2.5 what’s new 之 yield>之后,原来我不是特别关注 yield 的用法,因为对于2.3中加入的yield相对来说功能简单,它是作为一 ...

  4. 【 POJ - 1204 Word Puzzles】(Trie+爆搜|AC自动机)

    Word Puzzles Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 10782 Accepted: 4076 Special ...

  5. h.264宏块与子宏块类型

    宏块类型mb_type 宏块类型表示的是宏块不同的分割和编码方式,在h.264的语法结构中,宏块类型在宏块层(macroblock_layer)中用mb_type表示(请参考h.264语法结构分析中的 ...

  6. spring 动态数据源

    1.动态数据源:  在一个项目中,有时候需要用到多个数据库,比如读写分离,数据库的分布式存储等等,这时我们要在项目中配置多个数据库. 2.原理:   (1).spring 单数据源获取数据连接过程: ...

  7. 在前台运行Service

    一个前台的 service是被用户强烈关注的从而不会在内存低时被系统杀死.前台 service必须在状态栏上提供一个通知,这个通知被放在"正在进行"区域中,这表示这个通知不能被解除,除非服务停止了或者 ...

  8. 14.6.3.3 Making the Buffer Pool Scan Resistant

    14.6.3.3 Making the Buffer Pool Scan Resistant 相比使用一个严格的LRU算法,InnoDB 使用一个技术来最小化数据总量 带入到buffer pool 而 ...

  9. luoguP2265 路边的水沟

    题目:http://www.luogu.org/problem/show?pid=2265 题解:ans=C(n+m,n)%p 求一下逆元就行 代码: #include<cstdio> # ...

  10. 支付宝APP支付(Java后台生成签名具体步骤)

    /** *支付宝支付 * @param orderId 订单编号 * @param actualPay 实际支付金额 * @return */ private String getOrderInfoB ...