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>

  • 相关阅读:
    C# Bitmap类型与Byte[]类型相互转化
    博客园添加个人Github链接
    C# Exception has been thrown by the target of an invocation(调用的目标已抛出异常) 解决办法
    C# 使用Renci.SshNet连接SSH远程服务器
    Oracle 查询当前数据库版本信息
    Oracle ORA-12569: TNS:包校验和失败
    Oracle Rollup()函数
    Oracle 字符串补零
    DataGridView 表格排序后颜色丢失
    DataGridView 实现最后一列的宽度自适应
  • 原文地址:https://www.cnblogs.com/cycanfly/p/5415184.html
Copyright © 2011-2022 走看看