<?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. 一个异常org.apache.jasper.JasperException: java.lang.IllegalStateException: No output folder:的解决

    今天对一个WebApp做完修改,导出成war包,再发布到Tomcat7中,居然访问不了了! 同样的问题一周前也出现过,后来一顿鼓捣,又莫名其妙好了,当时认为是Tomcat7闹点小毛病,也没多想. 但是 ...

  2. leetCode 42.Trapping Rain Water(凹槽的雨水) 解题思路和方法

    Trapping Rain Water Given n non-negative integers representing an elevation map where the width of e ...

  3. 浅析JDK中ServiceLoader的源码

    前提 紧接着上一篇<通过源码浅析JDK中的资源加载>,ServiceLoader是SPI(Service Provider Interface)中的服务类加载的核心类,也就是,这篇文章先介 ...

  4. MySQL 中now()时间戳用法

    MySQL 中now()时间戳用法 UPDATE news set addtime = unix_timestamp(now()); #结果:1452001082  

  5. 【转帖】ArtisticStyle----很好用的C/C++样式格式化工具

    下载地址:http://srgb.googlecode.com/files/AStyle_2.02_windows.7z 把astyle.exe 复制到 C:\WINDOWS 目录里,省的指定路径VC ...

  6. sql各种连接详解

      迁移时间:2017年6月1日16:33:58 CreateTime--2016年9月14日11:19:00Author:Marydon sql各种连接详解 参考链接: http://www.jb5 ...

  7. 在CentOS上安装Git(转)

    CentOS的yum源中没有git,只能自己编译安装,现在记录下编译安装的内容,留给自己备忘. 确保已安装了依赖的包 yum install curl yum install curl-devel y ...

  8. Android使用AndEngine创建第一个程序

    首先要把andengine.jar复制到libs文件夹里 01 package com.hu.anden; 02   03 import org.anddev.andengine.engine.Eng ...

  9. EMQ --集成搭建

    集群方式接受 Erlang/OTP 最初是爱立信为开发电信设备系统设计的编程语言平台,电信设备(路由器.接入网关.…)典型设计是通过背板连接主控板卡与多块业务板卡的分布式系统. Erlang/OTP ...

  10. Android+手势识别详解

      今天就来把以前的学习文章与经验简单总结中出来吧,在这里我就直接把代码贴下来了,希望能给初学者做最佳的学习参考,也希望有更多的开发人员来加入 ANDROID开发团队,参与更多的创新方式的开发,好了, ...