这个东东以前没怎么用过,今天研究了一下,不难,感觉只是在某些方面很好用。

记录下,做个计算器。

<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:rowCount="5"
android:columnCount="4"
>
<Button
android:text="1"
/>
<Button
android:text="2"
/>
<Button
android:text="3"
/>
<Button
android:text="/"
/>
<Button
android:text="4"
/>
<Button
android:text="5"
/>
<Button
android:text="6"
/>
<Button
android:text="*"
/>
<Button
android:text="7"
/>
<Button
android:text="8"
/>
<Button
android:text="9"
/>
<Button
android:text="-"
/>
<Button
android:text="0"
android:layout_columnSpan="2"
android:layout_gravity="fill"
/>
<Button
android:text="."
/>
<Button
android:text="+"
android:layout_rowSpan="2"
android:layout_gravity="fill"
/>
<Button
android:text="="
android:layout_columnSpan="3"
android:layout_gravity="fill"
/> </GridLayout>

columnSpan类似于html表格中的,表示合并列。

版权声明:本文为博主原创文章,未经博主允许不得转载。若有错误地方,还望批评指正,不胜感激。

android开发之gridlayout使用入门的更多相关文章

  1. Android开发之Java集合类性能分析

    对于Android开发者来说深入了解Java的集合类很有必要主要是从Collection和Map接口衍生出来的,目前主要提供了List.Set和 Map这三大类的集合,今天Android吧(ard8. ...

  2. Android开发之InstanceState详解

    Android开发之InstanceState详解   本文介绍Android中关于Activity的两个神秘方法:onSaveInstanceState() 和 onRestoreInstanceS ...

  3. Android开发之Git配置

    Android开发之Git配置 1.首先git配置: 输入命令: git config --global user.name "xxx.xx" git config --globa ...

  4. 【Android UI】Android开发之View的几种布局方式及实践

    引言 通过前面两篇: Android 开发之旅:又见Hello World! Android 开发之旅:深入分析布局文件&又是“Hello World!” 我们对Android应用程序运行原理 ...

  5. Android开发之旅: Intents和Intent Filters(理论部分)

    引言 大部分移动设备平台上的应用程序都运行在他们自己的沙盒中.他们彼此之间互相隔离,并且严格限制应用程序与硬件和原始组件之间的交互. 我们知道交流是多么的重要,作为一个孤岛没有交流的东西,一定毫无意义 ...

  6. Android开发之ViewPager+ActionBar+Fragment实现响应式可滑动Tab

     今天我们要实现的这个效果呢,在Android的应用中十分地常见,我们可以看到下面两张图,无论是系统内置的联系人应用,还是AnyView的阅读器应用,我们总能找到这样的影子,当我们滑动屏幕时,Tab可 ...

  7. Android开发之Java必备基础

    Android开发之Java必备基础 Java类型系统 Java语言基础数据类型有两种:对象和基本类型(Primitives).Java通过强制使用静态类型来确保类型安全,要求每个变量在使用之前必须先 ...

  8. Android开发之PopupWindow

      /* *  Android开发之PopupWindow * *  Created on: 2011-8-8 *  Author: blueeagle *  Email: liujiaxiang@g ...

  9. [置顶] Android开发之MediaPlayerService服务详解(一)

    前面一节我们分析了Binder通信相关的两个重要类:ProcessState 和 IPCThreadState.ProcessState负责打开Binder 驱动,每个进程只有一个.而 IPCThre ...

随机推荐

  1. hdu 4720

    最小覆盖圆的模板: #include<stdio.h> #include<string.h> #include<math.h> struct Point { dou ...

  2. QLGame 2d Engine源码地址

    QLGame 2d Engine源码地址已经提交到github上,地址为:https://github.com/wsgzxl/QLGame2dEngine

  3. Spring 使用外部部署文件

    1.导入属性文件: <context:property-placeholder location="classpath:db.properties"/> 2.使用外部化 ...

  4. 详解如何用AD 生成Gerber文件

    以上gerber文件就出完了;  下面步骤是:进行导出" 钻孔文件 ". 以上钻孔文件就出完了;  到此就全部完成输出了. 下面的操作,也可以不用导的 .下面步骤是:进行导出&qu ...

  5. Android4.3 蓝牙BLE初步

    一.关键概念: Generic Attribute Profile (GATT) 通过BLE连接,读写属性类小数据的Profile通用规范.现在所有的BLE应用Profile都是基于GATT的.   ...

  6. OSS研究

    在以前没有毕业之前,做过了一个了播放器,其实就是mplayer的二次开发. 如果在这个播放器之上,加个oss作声音输入,那不就可以做个卡拉OK啦? 1.OSS的定义 OSS(Open Sound Sy ...

  7. iOS -view横向变成竖向

    -------

  8. 1.linux下Kconfig编写规范

    http://www.linuxidc.com/Linux/2011-10/44721.htm

  9. BZOJ_1588_&_Codevs_1296_[HNOI2002]_营业额统计(平衡树/set)

    描述 http://www.lydsy.com/JudgeOnline/problem.php?id=1588 给出每一天的营业值,求出之前的天当中与它相差最小的营业值与它的差的绝对值(第一天的差值为 ...

  10. Java 编程下 Eclipse 如何设置单行代码显示的最大宽度

    Eclipse 下一行代码的默认宽度是 80 , 稍长一点的一行代码就会自动换行,代码可读性较差,我们可以自己在 Eclipse 对代码宽度进行设置. 设置路径为:[Window]→[Preferen ...