Android——gridLayout(网格布局)
2016-03-26 00:47
411 查看
<?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虚拟机
相关文章推荐
- Andfix热修复框架原理及源码解析-下篇
- [Androidmac安装android studio 启动后,创建项目显示SDK problem]
- Android编码规范
- android的消息推送
- Android ListView工作原理完全解析,带你从源码的角度彻底理解,androidlistview
- Andfix热修复框架原理及源码解析-上篇
- Android加载一张3.4MB的图片,不出现OOM
- Android手机 Fildder真机抓包
- Android——RelativeLayout(相对布局)
- Android新手入门2016(14)--FragmentTabHost实现选项卡和菜单
- Android中的Selector的用法 .
- 关于iOS中类似于Android的Toast短暂提示框
- android RecyclerView首字母悬浮在顶部,滑动删除
- Android SDK Manager更新SDK终极办法(非翻墙)
- Android实现一键获取课程成绩dome
- Android起步之布局(1)LinearLayout
- Android的开源框架Android-Universal-Image-Loader的基本介绍
- android开发中遇到的安全问题
- 图片异步加载之 Android-Universal-Image-Loader
- Android中listview图片错乱问题及解决方案