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>

  • 相关阅读:
    最近正在计划编写一个麻将游戏
    连连看.NET v1.2版下载
    C#中使用指针转换数据类型[C#/unsafe]
    转载: 中国大部分程序员的通病
    C#休闲作品【连连看】开发心得与作品下载
    "连连看"算法笔记
    一个新游戏的思路;大家来说说看,觉得好的话,我做成游戏
    一个新游戏完成情况
    游戏演示(包含源码)[名称待定]
    Mzone 2.0换卡记
  • 原文地址:https://www.cnblogs.com/cycanfly/p/5415184.html
Copyright © 2011-2022 走看看