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>

  • 相关阅读:
    Redis 发布/订阅模式
    Task
    并发入门
    ThreadPool线程池
    C# 5.0 CallerMemberName CallerFilePath CallerLineNumber获取调用方法名称,路径,行号
    信号量
    互斥体
    锁机制
    .net remoting(1)简单例子
    C#并行编程-并发集合
  • 原文地址:https://www.cnblogs.com/cycanfly/p/5415184.html
Copyright © 2011-2022 走看看