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. Python 学习笔记(2) - 基本概念、运算符与表达式

    字符串 - 可以使用 3 种形式 - 单引号 :「'your string'」 - 双引号 :「"your string"」 - 三引号 :「'''your string''' 或 ...

  2. Spring MVC 统一异常处理

    Spring MVC 统一异常处理 看到 Exception 这个单词都心慌 如果有一天你发现好久没有看到Exception这个单词了,那你会不会想念她?我是不会的.她如女孩一样的令人心动又心慌,又或 ...

  3. SpringMVC源码阅读(三)

    先理一下Bean的初始化路线 org.springframework.beans.factory.support.AbstractBeanDefinitionReader public int loa ...

  4. jackson学习----解析豆瓣的图书信息

      异常一. org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple ...

  5. javascript日用代码集合(一)

    获取url参数 function get_url_param(name){ var reg = new RegExp("(^|&)" + name + "=([^ ...

  6. tyvj P1135 - 植物大战僵尸 最大权闭合图

    P1135 - 植物大战僵尸 From ytt    Normal (OI)总时限:10s    内存限制:128MB    代码长度限制:64KB 背景 Background 虽然这么多天了,,虽然 ...

  7. prototype.js 源码解读(02)

    如果你想研究一些比较大型的js框架的源码的话,本人建议你从其最初的版本开始研读,因为最初的版本东西少,易于研究,而后的版本基本都是在其基础上不断扩充罢了,所以,接下来我不准备完全解读prototype ...

  8. Codeforces Round #154 (Div. 2) : B

    一个很简单的题: 方法一: 二分. 代码: #include<cstdio> #include<algorithm> #define maxn 100005 using nam ...

  9. js backbone

    http://www.the5fire.com/backbone-js-tutorials-pdf-download.html http://www.infoq.com/cn/articles/mob ...

  10. 将数组转换成List

    采用比较好的方法Collections.addAll(arrayList, arr); arrayList是一个List arr是一个数组 并且要求arrayList与arr的类型是相同的  或    ...