GridLayout 计算器
2016-04-21 23:04
246 查看
<?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"> <TextView android:layout_width="match_parent" android:layout_height="200dp" android:background="#ccc" android:layout_columnSpan="4"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="C" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="DEL" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="÷" android:textSize="35sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="x" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="7" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="8" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1" /> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="9" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="-" android:textSize="35sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="4" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="5" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="6" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="+" android:textSize="30sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="1" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="2" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="3" android:textSize="25sp" android:layout_columnWeight="1" android:layout_rowWeight="1" /> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="=" android:textSize="30sp" android:layout_rowSpan="2" android:layout_gravity="fill" android:layout_columnWeight="1" android:layout_rowWeight="1"/> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="0" android:textSize="25sp" android:layout_columnSpan="2" android:layout_columnWeight="1" android:layout_rowWeight="1" /> <Button android:layout_width="0dp" android:layout_height="0dp" android:text="." android:textSize="25dp" android:layout_columnWeight="1" android:layout_rowWeight="1"/> </GridLayout>
View Code
![](https://images2015.cnblogs.com/blog/896258/201604/896258-20160421225700679-935942419.jpg)
相关文章推荐
- 1-分布式架构
- 【Android】内存泄漏调试
- MarkDown学习笔记
- ASP.NET MVC之从控制器传递数据到视图四种方式
- C语言问卷调查
- 贪心-背包问题
- 特征提取相关网址
- [HTTP:101170]The servlet DelServletContextAttr is referenced in servlet-mapping /servlet/DelServlet
- postfix 配置之 开启SASL认证遇到的问题
- 链表相关操作
- [Contiki系列论文之3]Protothread:简化内存受限系统上的事件驱动编程
- Spark-spark streaming
- android 横竖屏切换
- 周记
- VS2008切换时卡死解决方法
- HTTP协议(转)
- 个人工作总结03
- 学习笔记之awk用法
- Oracle11g修改SGA和PGA ORA-00845
- 问卷调查