zoukankan      html  css  js  c++  java
  • GridLayout 计算器

    <?xml version="1.0" encoding="utf-8"?>
    <GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:rowCount="6"
        android:columnCount="4">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:background="#ccc"
            android:layout_columnSpan="4"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="C"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="DEL"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="÷"
            android:textSize="35sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="x"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="7"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="8"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1" />
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="9"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="-"
            android:textSize="35sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="4"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="5"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="6"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="+"
            android:textSize="30sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="1"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="2"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="3"
            android:textSize="25sp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"
            />
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="="
            android:textSize="30sp"
            android:layout_rowSpan="2"
            android:layout_gravity="fill"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="0"
            android:textSize="25sp"
            android:layout_columnSpan="2"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1" />
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="."
            android:textSize="25dp"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
    
    </GridLayout>
    View Code

  • 相关阅读:
    文本特征选择的关键算法总结
    偏置-方差分解(Bias-Variance Decomposition)
    排列木桩
    七夕鹊桥分析
    第五十七课、模型视图设计模式(下)------------------狄泰软件学院
    第五十六课、模型视图设计模式(中)------------------狄泰软件学院
    第五十五课、模型视图设计模式(上)------------------狄泰软件学院
    第八十五课、多线程与界面组件的通信(下)------------------狄泰软件学院
    第八十四课、多线程与界面组件的通信(上)------------------狄泰软件学院
    第八十三课、另一种创建线程的方式------------------狄泰软件学院
  • 原文地址:https://www.cnblogs.com/wangchuanqi/p/5419315.html
Copyright © 2011-2022 走看看