zoukankan      html  css  js  c++  java
  • 安卓 计算器页面(表格布局)

    <?xml version="1.0" encoding="utf-8"?>
    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
    
    
    
        <EditText android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="right|bottom"/>
    
        <TableRow>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="mc"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="m+"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="m-"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="mr"/>
        </TableRow>
        <TableRow>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="AC"
                android:textColor="#00F"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="←"
                android:textColor="#00F"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="+/-"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="÷"/>
        </TableRow>
        <TableRow>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="7"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="8"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="9"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="x"/>
        </TableRow>
        <TableRow>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="4"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="5"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="6"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="-"/>
        </TableRow>
        <TableRow>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="1"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="2"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="3"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="+"/>
        </TableRow>
        <TableRow>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:text="0"/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="."/>
            <Button android:layout_width="0pt"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="="/>
        </TableRow>
    
    </TableLayout>

  • 相关阅读:
    Angular vs. React vs. Vue
    探索Virtual DOM的前世今生
    GRPC 负载均衡
    揭秘!用标准Go语言能写脚本吗?
    grpc 连接 复用 在 Go 中发现竞态条件 (Race Conditions)
    读取网络包
    User Datagram Protocol
    注册表项 DeviceInstance
    gopacket 抓包 过滤器
    Mysql 通信协议抓包分析
  • 原文地址:https://www.cnblogs.com/cycanfly/p/5415184.html
Copyright © 2011-2022 走看看