<?xml version="1.0" encoding="utf-8"?>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:rowCount="6"
android:columnCount="4">
<!--6行4列
实现占满整个屏幕--> <EditText
android:hint="数值"
android:layout_columnSpan="4"
android:layout_gravity="fill_horizontal"
android:layout_rowWeight="2"
/>
<!--跨四列 自动填充 权重2-->
<Button
android:text="清除"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"
android:textColor="#00F"/>
//列 行权重为1
<Button
android:text="后退"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="/"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="x"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="7"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="8"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="9"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="-"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="4"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="5"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="6"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="+"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="1"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="2"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="3"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行权重为1
<Button
android:text="="
android:layout_rowSpan="2"
android:layout_gravity="fill_vertical"
android:layout_columnWeight="1"
android:layout_rowWeight="2"
android:textSize="20dp"
android:background="#22ac38"/>
//跨两行 自动填充 绿色 列权重1 行权重2
<Button
android:text="0"
android:layout_columnSpan="2"
android:layout_gravity="fill_horizontal"
android:layout_columnWeight="2"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//跨两列 自动填充 列权重2 行权重1
<Button
android:text="."
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:textSize="20dp"/>
//列 行 权重1 </GridLayout>

6.0虚拟机

Android——gridLayout(网格布局)的更多相关文章

  1. Android精通:TableLayout布局,GridLayout网格布局,FrameLayout帧布局,AbsoluteLayout绝对布局,RelativeLayout相对布局

    在Android中提供了几个常用布局: LinearLayout线性布局 RelativeLayout相对布局 FrameLayout帧布局 AbsoluteLayout绝对布局 TableLayou ...

  2. Android零基础入门第32节:新推出的GridLayout网格布局

    原文:Android零基础入门第32节:新推出的GridLayout网格布局 本期主要学习的是网格布局是Android 4.0新增的布局,和前面所学的TableLayout表格布局 有点类似,不过他有 ...

  3. Android之GridLayout网格布局

    1.相关属性 GridLayout网格布局是4.0之后引入的布局方式! android:columnCount="4" //设置列数(4列) android:rowCount=&q ...

  4. Android开发---网格布局案例

     Android开发---网格布局案例 效果图: 1.MainActivity.java package com.example.android_activity; import android.ap ...

  5. android的布局-----GridLayout(网格布局)

    学习导图 (一)简介 网格布局由GridLayout所代表,在android4.0之后新增加的布局管理器,因此需要android4.0之后的版本中使用,如果在更早的平台使用该布局管理器,则需要导入相应 ...

  6. GridLayout(网格布局)

    常用属性: 排列对齐: ①设置组件的排列方式:  android:orientation=""     vertical(竖直,默认)或者horizontal(水平) ②设置组件的 ...

  7. Android RecyclerView网格布局

    一个简单的网格布局activity_main.xml <?xml version="1.0" encoding="utf-8"?> <andr ...

  8. GridLayout网格布局

    网格布局特点: l  使容器中的各组件呈M行×N列的网格状分布. l  网格每列宽度相同,等于容器的宽度除以网格的列数. l  网格每行高度相同,等于容器的高度除以网格的行数. l  各组件的排列方式 ...

  9. java 图形化小工具Abstract Window Toolit ;布局管理器FlowLayout流式布局;BorderLayout边界布局;GridLayout网格布局;CardLayou重叠卡片布局;BoxLayout方框布局;绝对定位

    1.FlowLayout流式布局管理器: FlowLayout布局管理器中,组件像水流一样向某方向流动(排列),遇到障碍(边界)就折回,重头开始排列 .在默认情况下,FlowLayout局管理器从左向 ...

随机推荐

  1. Microjs: 超棒的迷你框架和迷你类库搜罗工具

    你可以按条件方便的搜索需要的类库或者框架,以下为条件 基础框架 模板引擎 DOM操作 CSS动画 Javascript动画 数据操作 更多 阅读原文:Microjs: 超棒的迷你框架和迷你类库搜罗工具

  2. css 小问题解决方法整理

    1,图片垂直居中: 设置包括图片的div:height=20px:line-height=20px. 设置图片vertical-align:middle 就可以. 2,行内块元素有3px bug,可通 ...

  3. ExplorerControls的显示问题

    我们都知道ArcGIS桌面版本"添加数据"的功能是弹出一选择对话框,如下图所示,但我们总想搞自己的,以便融入自己的风格.下图左边是ArcGIS自带的"添加数据" ...

  4. gsoap

    C++中如何使用gsoap开发WebService 1. 什么是gSOAPgSOAP是一个夸平台的,用于开发Web Service服务端和客户端的工具,在Windows.Linux.MAC OS和UN ...

  5. Cleaner ITweenPath Source

    iTweenPath.cs [pyg language="csharp" s="monokai" ] //Slight additions for a clea ...

  6. OpenERP财务管理若干概念讲解

    来自:http://shine-it.net/index.php/topic,2431.0.html 一.记账凭证(Account Move) 会计上的记账凭证,也叫会计分录,在OpenERP中叫&q ...

  7. this详解与面向对象编程

      原文链接:http://www.cnblogs.com/kongxy/p/4581223.html JS中的this对象详解 声明:文章转载自上面地址,版权归阿孔所有,这里仅供本人学习笔记使用 t ...

  8. 〖Linux〗通过USB连接,共享Linux上的网络,使用Android手机上网。

    1. Android手机上打开USB共享 2. Linux上修改USB0的ip地址并启用 sudo ifconfig usb0 192.168.42.127 up 3. Android手机上修改路由表 ...

  9. 转:【微信小程序】 微信小程序-拍照或选择图片并上传文件

    调用拍照API:https://mp.weixin.qq.com/debug/wxadoc/dev/api/media-picture.html?t=20161222#wxchooseimageobj ...

  10. JavaScript异常处理

    http://www.yaosansi.com/post/747.html 异常处理概述      在代码的运行过程中,错误是不可避免的,总的来说,错误发生于两种情况:一是程序内部的逻辑或者语法错误, ...