表格布局(TableLayout)

 <?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="*" >
<EditText
android:layout_width="match_parent"
android:layout_height="60dp"
android:gravity="center_vertical|right"
android:layout_weight="1"/>
<TableRow
android:layout_weight="1"> <Button
android:id="@+id/btn7"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="7" /> <Button
android:id="@+id/btn8"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="8" /> <Button
android:id="@+id/btn9"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="9" /> <Button
android:id="@+id/btnchu"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="/" />
</TableRow> <TableRow
android:layout_weight="1"> <Button
android:id="@+id/btn4"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="4" /> <Button
android:id="@+id/btn5"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="5" /> <Button
android:id="@+id/btn6"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="6" /> <Button
android:id="@+id/btncheng"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="*" />
</TableRow> <TableRow
android:layout_weight="1"> <Button
android:id="@+id/btn1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="1" /> <Button
android:id="@+id/btn2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="2" /> <Button
android:id="@+id/btn3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="3" /> <Button
android:id="@+id/btnjian"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="-" />
</TableRow> <TableRow
android:layout_weight="1"> <Button
android:id="@+id/btn0"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="0" /> <Button
android:id="@+id/btndian"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="." /> <Button
android:id="@+id/btnjia"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="+" /> <Button
android:id="@+id/btndeng"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="=" />
</TableRow> <TableRow
android:layout_weight="1"> <Button
android:id="@+id/clear"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_span="4"
android:text="clear" />
</TableRow> </TableLayout>

                     

      离魂莫惆怅,看取宝刀雄

Android 计算器UI-TableLayout的更多相关文章

  1. Android计算器布局

    Android(安桌)计算器布局实现         ——解决整个屏幕方案 引言:     学完了android布局的几种方式,做了一个android计算器. 我在网上搜索了这方面的资料,发现了布局都 ...

  2. Android开发 UI布局

    Android开发 UI布局一.线性布局LinearLayout 什么是线性布局? 其实呢,线性布局就是把所有的孩子摆在同一条线上 <?xml version="1.0" e ...

  3. 【Android源代码下载】收集整理android界面UI效果源码

    在Android开发中,Android界面UI效果设计一直都是很多童鞋关注的问题,今天给大家分享下大神收集整理的多个android界面UI效果,都是源码,都是干货,贡献给各位网友! 话不多说,直接上效 ...

  4. Android 布局之TableLayout

    Android 布局之TableLayout 1 TableLayout简介 TableLayout是表格布局.TableLayout 可设置的属性包括全局属性及单元格属性. 1.1 全局属性 有以下 ...

  5. Android优化——UI检视利器:Hierarchy Viewer

    在Android的SDK工具包中,有很多十分有用的工具,可以帮助程序员开发和测试Android应用程序,大大提高其工作效率.其中的一款叫 Hierachy Viewer的可视化调试工具,可以很方便地在 ...

  6. android自定义UI模板图文详解

    不知道大家在实际开发中有没有自定义过UI模板?今天花时间研究了一下android中自定义UI模板,与大家分享一下. 每个设计良好的App都是自定义标题栏,在自定义标题栏的过程中大部分人可能都是自定义一 ...

  7. Android 高级UI设计笔记07:RecyclerView 的详解

    1. 使用RecyclerView       在 Android 应用程序中列表是一个非常重要的控件,适用场合非常多,如新闻列表.应用列表.消息列表等等,但是从Android 一出生到现在并没有非常 ...

  8. Android开发UI之开源项目第一篇——个性化控件(View)篇

    原文:http://blog.csdn.net/java886o/article/details/24355907 本文为那些不错的Android开源项目第一篇——个性化控件(View)篇,主要介绍A ...

  9. Android开发--UI之Bundle的使用

    Android开发–UI之Bundle的使用 最近,把之前学过的东西大体的整理了以下,并且想把学过的心得分享给大家.我自己做了一个小小的demo,以便说明具体的应用. 这里的两个界面是通过第一个界面输 ...

  10. Android 更新UI的两个方法

    Android 更新UI的两个方法 在Android的开发过程中,常常需要适时的更新UI.Androd中的UI是在主线程中更新的.如果在主线程之外的线程中直接更新,就会出现报错并抛出异常: andro ...

随机推荐

  1. netbeans中给jpanl添加背景图片制定代码的理解——匿名内部类继承父类

    此测试是为了仿照在netbeans中给jpanl添加背景图片的制定代码的执行过程 在JpDemo中定义了个Car类的数据类型,但在给其赋值对象时使用了匿名内部类,继承了Car类,是其子类,并重写了父类 ...

  2. Uva 10537 过路费

    题目链接:http://vjudge.net/contest/143062#problem/C 题意: 给定一个无向图,大写字母是城市,小写字母是村庄,经过城市交过路费为当前货物的%5,路过村庄固定交 ...

  3. easyui datagrid 行右键生成 动态获取(toolbar) 按钮

    var createGridRowContextMenu = function(e, rowIndex, rowData) { e.preventDefault(); var grid = $(thi ...

  4. Number To Indian Rupee Words in Oracle Forms / Reports

    Convert numbers to Indian Rupees format in Oracle Forms / Reports.Create the below mention function ...

  5. 《BI项目笔记》增量ETL数据抽取的策略及方法

    增量抽取 增量抽取只抽取自上次抽取以来数据库中要抽取的表中新增或修改的数据.在ETL使用过程中.增量抽取较全量抽取应用更广.如何捕获变化的数据是增量抽取的关键.对捕获方法一般有两点要求:准确性,能够将 ...

  6. filter 过滤缓存

    package fifter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.Filter ...

  7. checkbox将选中的数据提交到后台

    在项目中有些地方需要批量添加的数据,在这里使用到checkbox比较方便一些. 例如:我需要将多个包添加到同一个地区的 主要的前端代码: 这个是用来放checkbox的. <div id=&qu ...

  8. 转!!mybatis在xml文件中处理大于号小于号的方法

    第一种方法: 用了转义字符把>和<替换掉,然后就没有问题了. SELECT * FROM test WHERE 1 = 1 AND start_date  <= CURRENT_DA ...

  9. Android之打log

    Android之打log 1.在代码中加上自己的log 2,模块编译mm -B或者./mk mm/mmm packages/apps/Contacts/ 3编译成功后install或者push生成的a ...

  10. BitMap存储jpg到手机sd卡中

    /** * 将BitMap转成Jpeg图片保存到sdcard(便于以后debug调试查看和裁切调试) */ private void saveBitmap(Bitmap bitmap, String ...