zoukankan      html  css  js  c++  java
  • Android计算器界面 TableLayout

      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:stretchColumns="1"
      6 
      7     >
      8     <TableRow
      9         >
     10         <EditText
     11             android:layout_width="0dp"
     12             android:layout_height="wrap_content"
     13             android:layout_span="4"
     14             android:height="110dp"
     15             android:background="#000"/>
     16     </TableRow>
     17     <TableRow
     18         android:layout_marginRight="0dp">
     19     <Button
     20         android:layout_width="0dp"
     21         android:layout_height="80dp"
     22         android:text="C"
     23         android:textSize="30dp"
     24         android:background="#C0C0C0"
     25         android:layout_weight="1"
     26         />
     27     <Button
     28         android:layout_width="0dp"
     29         android:layout_height="80dp"
     30         android:text="+/-"
     31         android:textSize="30dp"
     32         android:background="#C0C0C0"
     33         android:layout_weight="1"/>
     34     <Button
     35         android:layout_width="0dp"
     36         android:layout_height="80dp"
     37         android:text="%"
     38         android:textSize="30dp"
     39         android:background="#C0C0C0"
     40         android:layout_weight="1"/>
     41     <Button
     42         android:layout_width="0dp"
     43         android:layout_height="80dp"
     44         android:text="÷"
     45         android:textSize="30dp"
     46         android:textColor="#ffffff"
     47         android:background="#ffa500"
     48         android:layout_weight="1"/>
     49 </TableRow>
     50     <TableRow
     51         android:layout_margin="0dp">
     52         <Button
     53             android:layout_width="0dp"
     54             android:layout_height="80dp"
     55             android:text="7"
     56             android:textSize="30dp"
     57             android:background="#C0C0C0"
     58             android:layout_weight="1"/>
     59         <Button
     60             android:layout_width="0dp"
     61             android:layout_height="80dp"
     62             android:text="8"
     63             android:textSize="30dp"
     64             android:background="#C0C0C0"
     65             android:layout_weight="1"/>
     66         <Button
     67             android:layout_width="0dp"
     68             android:layout_height="80dp"
     69             android:text="9"
     70             android:textSize="30dp"
     71             android:background="#C0C0C0"
     72             android:layout_weight="1"/>
     73         <Button
     74             android:layout_width="0dp"
     75             android:layout_height="80dp"
     76             android:text="X"
     77             android:textSize="30dp"
     78             android:textColor="#ffffff"
     79             android:background="#ffa500"
     80             android:layout_weight="1"/>
     81     </TableRow>
     82     <TableRow>
     83         <Button
     84             android:layout_width="0dp"
     85             android:layout_height="80dp"
     86             android:text="4"
     87             android:textSize="30dp"
     88             android:background="#C0C0C0"
     89             android:layout_weight="1"/>
     90         <Button
     91             android:layout_width="0dp"
     92             android:layout_height="80dp"
     93             android:text="5"
     94             android:textSize="30dp"
     95             android:background="#C0C0C0"
     96             android:layout_weight="1"/>
     97         <Button
     98             android:layout_width="0dp"
     99             android:layout_height="80dp"
    100             android:text="6"
    101             android:textSize="30dp"
    102             android:background="#C0C0C0"
    103             android:layout_weight="1"/>
    104         <Button
    105             android:layout_width="0dp"
    106             android:layout_height="80dp"
    107             android:text="-"
    108             android:textSize="30dp"
    109             android:textColor="#ffffff"
    110             android:background="#ffa500"
    111             android:layout_weight="1"/>
    112     </TableRow>
    113     <TableRow>
    114         <Button
    115             android:layout_width="0dp"
    116             android:layout_height="80dp"
    117             android:text="1"
    118             android:textSize="30dp"
    119             android:background="#C0C0C0"
    120             android:layout_weight="1"/>
    121         <Button
    122             android:layout_width="0dp"
    123             android:layout_height="80dp"
    124             android:text="2"
    125             android:textSize="30dp"
    126             android:background="#C0C0C0"
    127             android:layout_weight="1"/>
    128         <Button
    129             android:layout_width="0dp"
    130             android:layout_height="80dp"
    131             android:text="3"
    132             android:textSize="30dp"
    133             android:background="#C0C0C0"
    134             android:layout_weight="1"/>
    135         <Button
    136             android:layout_width="0dp"
    137             android:layout_height="80dp"
    138             android:text="+"
    139             android:textSize="30dp"
    140             android:textColor="#ffffff"
    141             android:background="#ffa500"
    142             android:layout_weight="1"/>
    143     </TableRow>
    144     <TableRow>
    145         <Button
    146             android:layout_width="0dp"
    147             android:layout_height="80dp"
    148             android:text="0"
    149             android:textSize="30dp"
    150             android:background="#C0C0C0"
    151             android:layout_weight="2" />
    152 
    153         <Button
    154             android:layout_width="0dp"
    155             android:layout_height="80dp"
    156             android:text="."
    157             android:textSize="30dp"
    158             android:background="#C0C0C0"
    159             android:layout_weight="1"/>
    160         <Button
    161             android:layout_width="0dp"
    162             android:layout_height="80dp"
    163             android:text="="
    164             android:textSize="30dp"
    165             android:textColor="#ffffff"
    166             android:background="#ffa500"
    167             android:layout_weight="1" />
    168     </TableRow>
    169 
    170 </TableLayout>
    计算器界面

  • 相关阅读:
    CSS3选择器:nth-child和:nth-of-type的差异
    H5 设计尺寸
    笔试题的各种trick
    OpenCV2.4.9 + VS2012 + win10 配置
    四种IO模型
    深信服笔试
    哈希表
    TimeOut Error :因为远程服务器关闭导致mnist数据集不能通过input_data下载下来
    Http协议对格式、请求头、方法
    GDB调试
  • 原文地址:https://www.cnblogs.com/arxk/p/5410540.html
Copyright © 2011-2022 走看看