Android——gridLayout(网格布局)

<?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(网格布局)的更多相关文章
- Android精通:TableLayout布局,GridLayout网格布局,FrameLayout帧布局,AbsoluteLayout绝对布局,RelativeLayout相对布局
在Android中提供了几个常用布局: LinearLayout线性布局 RelativeLayout相对布局 FrameLayout帧布局 AbsoluteLayout绝对布局 TableLayou ...
- Android零基础入门第32节:新推出的GridLayout网格布局
原文:Android零基础入门第32节:新推出的GridLayout网格布局 本期主要学习的是网格布局是Android 4.0新增的布局,和前面所学的TableLayout表格布局 有点类似,不过他有 ...
- Android之GridLayout网格布局
1.相关属性 GridLayout网格布局是4.0之后引入的布局方式! android:columnCount="4" //设置列数(4列) android:rowCount=&q ...
- Android开发---网格布局案例
Android开发---网格布局案例 效果图: 1.MainActivity.java package com.example.android_activity; import android.ap ...
- android的布局-----GridLayout(网格布局)
学习导图 (一)简介 网格布局由GridLayout所代表,在android4.0之后新增加的布局管理器,因此需要android4.0之后的版本中使用,如果在更早的平台使用该布局管理器,则需要导入相应 ...
- GridLayout(网格布局)
常用属性: 排列对齐: ①设置组件的排列方式: android:orientation="" vertical(竖直,默认)或者horizontal(水平) ②设置组件的 ...
- Android RecyclerView网格布局
一个简单的网格布局activity_main.xml <?xml version="1.0" encoding="utf-8"?> <andr ...
- GridLayout网格布局
网格布局特点: l 使容器中的各组件呈M行×N列的网格状分布. l 网格每列宽度相同,等于容器的宽度除以网格的列数. l 网格每行高度相同,等于容器的高度除以网格的行数. l 各组件的排列方式 ...
- java 图形化小工具Abstract Window Toolit ;布局管理器FlowLayout流式布局;BorderLayout边界布局;GridLayout网格布局;CardLayou重叠卡片布局;BoxLayout方框布局;绝对定位
1.FlowLayout流式布局管理器: FlowLayout布局管理器中,组件像水流一样向某方向流动(排列),遇到障碍(边界)就折回,重头开始排列 .在默认情况下,FlowLayout局管理器从左向 ...
随机推荐
- Linux专家心目中的最佳Linux发行版有哪些?
坦率地说,我对Linux桌面的关注程度多于对Linux发行版的关注.在我看来,桌面环境是创新不断的领域.我认为,如果某个发行版呼吁关注自己,可能哪里出了岔子.不过,有一些Linux发行版还是我青睐的. ...
- 极客Web开发资源大荟萃
前端开发已经成为当前炙手可热的技术之一.此次我们总结的前端开发包含了相关技术和流行趋势,希望从中大家可以挖掘你们所需要的,并带给你们最有价值的帮助!原文来自:极客标签 使用代码回放来愉快地学习前端知识 ...
- UNIX网络编程读书笔记:简介
认知套接口编程接口 理解原始套接口(raw socket)的概念 值得注意的是,客户和服务器是典型的用户进程,而TCP和IP协议则通常是系统内核协议栈的一部分. 上图中在TCP和UDP之间留有间隙 ...
- ng-class
在前面Angularjs开发一些经验总结中我们说到在angular开发中angular controller never 包含DOM元素(html/css),在controller需要一个简单的POJ ...
- unix 网络编程 第五章
个人对unix 网络编程中的代码进行了精简,保留了主要和关键部分. 1 tcpserve01 程序见 https://github.com/juniperdiego/Unix-network-prog ...
- oracle 存储过程 返回结果集
oracle 存储过程 返回结果集 CreationTime--2018年8月14日09点50分 Author:Marydon 1.情景展示 oracle存储过程如何返回结果集 2.解决方案 最简 ...
- gdb调试运行程序带参数(调用动态链接库),debug过程记录
library多线程file1.gdb (运行程序名称) 例如 gdb cbenchmark 2.设置运行参数 set args -c 1 -n 1 -F ./libaliww.so -l 1 3.如 ...
- js表单验证控制代码大全
http://www.cnblogs.com/SAL2928/archive/2008/10/24/1319020.html目录: 1:js 字符串长度限制.判断字符长度.js限制输入.限制不能输入. ...
- jquery切换class
<ul class="nva_sele_txt" id=""> <a href="#" class= ...
- intelliJ IDEA 配置MySQL数据库 详解
1> 在主界面中,点击右边侧栏的 Database ,在点击 + ,再Data Source 选择数据库 2> 填入 Database 数据库名,在输入 User 和 Password ...