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:layout_columnSpan="4"
            android:hint="0"
            android:gravity="bottom|right"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="C"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="DEL"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="/"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="X"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="7"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="8"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="9"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="-"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="4"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="5"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="6"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="+"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="1"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="2"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="3"
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="="
            android:layout_columnWeight="1"
            android:layout_rowSpan="2"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="0"
            android:layout_columnWeight="1"
            android:layout_columnSpan="2"
            android:layout_rowWeight="1"/>
        <Button
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:text="."
            android:layout_columnWeight="1"
            android:layout_rowWeight="1"/>
    
    </GridLayout>

  • 相关阅读:
    layui table表格 表头与内容列错位问题(只有纵向滚动条的情况)
    layui table+复杂表头+合并单元格
    echarts 柱状图
    1-jdk的安装与配置
    变量的解构赋值(对象)
    变量的解构赋值(数组)
    git常用命令
    markdown常用语法
    微信小程序全局/页面配置
    git使用简介(二)
  • 原文地址:https://www.cnblogs.com/beens/p/5420102.html
Copyright © 2011-2022 走看看