1. <?xml version="1.0" encoding="utf-8"?>
  2. <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:layout_row="4"
  6. android:stretchColumns="3">
  7. <EditText
  8. android:layout_width="387dp"
  9. android:layout_height="170dp"
  10. android:editable="true"
  11. android:inputType="number"
  12. android:textSize="30dp"
  13. android:background="#999">
  14. </EditText>
  15. <TableRow>
  16. <Button
  17. android:layout_width="0dp"
  18. android:layout_height="70dp"
  19. android:text="CE"
  20. android:textSize="40dp"
  21. android:background="#990"
  22. android:textColor="#FFF"
  23. android:layout_weight="1"/>
  24. <Button
  25. android:layout_width="0dp"
  26. android:layout_height="70dp"
  27. android:text="C"
  28. android:textSize="40dp"
  29. android:background="#990"
  30. android:textColor="#FFF"
  31. android:layout_weight="1"/>
  32. <Button
  33. android:layout_width="0dp"
  34. android:layout_height="70dp"
  35. android:textSize="40dp"
  36. android:background="#990"
  37. android:textColor="#FFF"
  38. android:text="()"
  39. android:layout_weight="1"/>
  40. <Button
  41. android:layout_width="0dp"
  42. android:layout_height="70dp"
  43. android:text="+"
  44. android:textSize="40dp"
  45. android:background="#990"
  46. android:textColor="#FFF"
  47. android:layout_weight="1"/>
  48.  
  49. </TableRow>
  50. <TableRow>
  51. <Button
  52. android:layout_width="0dp"
  53. android:layout_height="70dp"
  54. android:text="7"
  55. android:textSize="40dp"
  56. android:background="#999"
  57. android:textColor="#FFF"
  58. android:layout_weight="1"/>
  59. <Button
  60. android:layout_width="0dp"
  61. android:layout_height="70dp"
  62. android:text="8"
  63. android:textSize="40dp"
  64. android:background="#999"
  65. android:textColor="#FFF"
  66. android:layout_weight="1"/>
  67. <Button
  68. android:layout_width="0dp"
  69. android:layout_height="70dp"
  70. android:text="9"
  71. android:textSize="40dp"
  72. android:background="#999"
  73. android:textColor="#FFF"
  74. android:layout_weight="1"/>
  75. <Button
  76. android:layout_width="0dp"
  77. android:layout_height="70dp"
  78. android:text="-"
  79. android:textSize="40dp"
  80. android:background="#990"
  81. android:textColor="#FFF"
  82. android:layout_weight="1"/>
  83. </TableRow>
  84. <TableRow>
  85. <Button
  86. android:layout_width="0dp"
  87. android:layout_height="70dp"
  88. android:text="4"
  89. android:textSize="40dp"
  90. android:background="#999"
  91. android:textColor="#FFF"
  92. android:layout_weight="1"/>
  93. <Button
  94. android:layout_width="0dp"
  95. android:layout_height="70dp"
  96. android:text="5"
  97. android:textSize="40dp"
  98. android:background="#999"
  99. android:textColor="#FFF"
  100. android:layout_weight="1"/>
  101. <Button
  102. android:layout_width="0dp"
  103. android:layout_height="70dp"
  104. android:text="6"
  105. android:textSize="40dp"
  106. android:background="#999"
  107. android:textColor="#FFF"
  108. android:layout_weight="1"/>
  109. <Button
  110. android:layout_width="0dp"
  111. android:layout_height="70dp"
  112. android:text="*"
  113. android:textSize="40dp"
  114. android:background="#990"
  115. android:textColor="#FFF"
  116. android:layout_weight="1"/>
  117. </TableRow>
  118. <TableRow>
  119. <Button
  120. android:layout_width="0dp"
  121. android:layout_height="70dp"
  122. android:text="1"
  123. android:textSize="40dp"
  124. android:background="#999"
  125. android:textColor="#FFF"
  126. android:layout_weight="1"/>
  127. <Button
  128. android:layout_width="0dp"
  129. android:layout_height="70dp"
  130. android:text="2"
  131. android:textSize="40dp"
  132. android:background="#999"
  133. android:textColor="#FFF"
  134. android:layout_weight="1"/>
  135. <Button
  136. android:layout_width="0dp"
  137. android:layout_height="70dp"
  138. android:text="3"
  139. android:textSize="40dp"
  140. android:background="#999"
  141. android:textColor="#FFF"
  142. android:layout_weight="1"/>
  143.  
  144. <Button
  145. android:layout_width="0dp"
  146. android:layout_height="70dp"
  147. android:text="÷"
  148. android:textSize="40dp"
  149. android:background="#990"
  150. android:textColor="#FFF"
  151. android:layout_column="3"
  152. android:layout_weight="1"/>
  153. </TableRow>
  154. <TableRow>
  155. <Button
  156. android:layout_width="0dp"
  157. android:layout_height="70dp"
  158. android:text="0"
  159. android:textSize="40dp"
  160. android:background="#999"
  161. android:textColor="#FFF"
  162. android:layout_weight="1"/>
  163. <Button
  164. android:layout_width="0dp"
  165. android:layout_height="70dp"
  166. android:text="00"
  167. android:textSize="40dp"
  168. android:background="#999"
  169. android:textColor="#FFF"
  170. android:layout_weight="1"/>
  171. <Button
  172. android:layout_width="0dp"
  173. android:layout_height="70dp"
  174. android:text="."
  175. android:textSize="40dp"
  176. android:background="#999"
  177. android:textColor="#FFF"
  178. android:layout_weight="1"/>
  179. <Button
  180. android:layout_width="0dp"
  181. android:layout_height="70dp"
  182. android:text="="
  183. android:textSize="40dp"
  184. android:background="#990"
  185. android:textColor="#FFF"
  186. android:layout_weight="1"/>
  187. </TableRow>
  188. </TableLayout>

Android-表格布局 计算器 修改版的更多相关文章

  1. Android表格布局(Table Layout)

    Android表格布局(Table Layout) 先来看布局管理器之间继承关系图: 图1 可知TableLayout继承了LinearLayout,所以表格布局本质上依然是线性管理器. 表格布局采用 ...

  2. Android表格布局之设置边框

    Android表格布局本身没有边框,不过可以通过背景色的设置可以实现表格边框的显示. 首先可以设置TableRow的背景色,然后设置内容的背景色.根据它们的颜色差就出现了边框.只要微调Content与 ...

  3. Android 表格布局<TableLayout>

    表格布局即,tableLayout,表格布局通过行.列的形式来管理UI组件,TablelLayout并不需要明确地声明包含多少行.多少列,而是通过TableRow,以及其他组件来控制表格的行数和列数, ...

  4. [android] 表格布局和绝对布局

    /*****************2016年4月28日 更新*************************************/ 知乎:为什么Android没有像iOS一样提供autolay ...

  5. Android 表格布局 TableLayout

    属性介绍 stretchColumns:列被拉伸 shrinkColumns:列被收缩 collapseColumns:列被隐藏 举例测试 <TableLayout android:id=&qu ...

  6. Android 网格布局 计算器

    <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools=&quo ...

  7. Android 线性布局 计算器

    <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...

  8. 案例:TableLayout表格布局——迷你计算器

    计算器可以常用线性布局(LinearLayout)和表格布局(tableLayout).Gridlayout 今天我用的是表格布局 效果如下: 代码如下: <TableLayout xmlns: ...

  9. Android 仿美团网,大众点评购买框悬浮效果之修改版

    转帖请注明本文出自xiaanming的博客(http://blog.csdn.net/xiaanming/article/details/17761431),请尊重他人的辛勤劳动成果,谢谢! 我之前写 ...

随机推荐

  1. server端推送消息机制

    推送技术相关请参加WIKI: https://zh.wikipedia.org/wiki/%E6%8E%A8%E9%80%81%E6%8A%80%E6%9C%AF 场景: 监控系统:后台硬件温度.电压 ...

  2. React的一个简单示例

    首发:个人博客,更新&纠错&回复 React的核心是定义组件类,组件有三个要素:状态.行为.界面. 1.渲染状态到界面:状态由组件对象的state属性持有,从状态到界面的渲染工作由组件 ...

  3. JSP/Servlet 中的汉字编码问题

    JSP/Servlet 中的汉字编码问题 1.问题的起源 每个国家(或区域)都规定了计算机信息交换用的字符编码集,如美国的 ASCII,中国的 GB2312 -80,日本的 JIS 等,作为该国家/区 ...

  4. jQuery DataTable-JavaScript API

    虽然大多数时候你的Javascript交互将通过使用datatable初始化对象作为描述在使用这个网站的部分,有时,你会发现它有用一些外部控制表.可以使用以下函数从jQuery.dataTable对象 ...

  5. java中OutputStream字节流与字符流InputStreamReader 每一种基本IO流BufferedOutputStream,FileInputStream,FileOutputStream,BufferedInputStream,BufferedReader,BufferedWriter,FileInputStream,FileReader,FileWriter,InputStr

    BufferedOutputStream,FileInputStream,FileOutputStream,BufferedInputStream,BufferedReader,BufferedWri ...

  6. 虚拟机 本地 本机 双启动 运行 vhd local Dual Boot

    在使用虚拟机的过程中, 可能会遇到虚拟机的运行要求过高, 电脑力不从心的情况. 为了让虚拟机使用更多电脑资源, 可以让虚拟机以本地双系统的方式,访问本地计算机资源. 打开磁盘管理,在磁盘上右键,选择 ...

  7. 图示-Centos7完整安装

    工作过程中,一些未接触过Centos,或未安装过Centos的同事经常会问,如何安装?这个事说简单真简单,只有操作过一次,第二次就能够熟练的自己动手安装:但说难也难,如果没人带,第一次安装的时候确实不 ...

  8. symfony中twig的模板过滤器

    过滤器 变量可以被过滤器修饰.过滤器和变量用(|)分割开.过滤器也是可以有参数的.过滤器也可以被多重使用. 通用过滤器 date过滤器 1.1版本新增时区支持,1.5版本增加了默认的日期格式.格式化时 ...

  9. python: 字符串按空格分成列表split与加密密码maketrans

    #字符串按空格分成列表split() print("fu li mei".split()) #split按空格分成列表 print("1+a+2+b".spli ...

  10. vnc里鼠标拖动终端就会产生ctrl+c终端

    然后把有道词典给关了就好了...