zoukankan      html  css  js  c++  java
  • Android五大布局详解——GridLayout(网格布局)

    GridLayout

    本章以一个小的实现示例讲述:
    实现效果如图:

    代码实现:

    <?xml version="1.0" encoding="utf-8"?>
    <GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/GridLayout1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:columnCount="4"
        android:orientation="horizontal"
        android:rowCount="6" >
    
        <TextView
            android:layout_columnSpan="4"
            android:layout_gravity="fill"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp"
            android:background="#FFCCCC"
            android:text="0"
            android:textSize="50sp" />
    
        <Button
            android:layout_columnSpan="2"
            android:layout_gravity="fill"
            android:text="回退" />
    
        <Button
            android:layout_columnSpan="2"
            android:layout_gravity="fill"
            android:text="清空" />
    
        <Button android:text="+" />
    
        <Button android:text="1" />
    
        <Button android:text="2" />
    
        <Button android:text="3" />
    
        <Button android:text="-" />
    
        <Button android:text="4" />
    
        <Button android:text="5" />
    
        <Button android:text="6" />
    
        <Button android:text="*" />
    
        <Button android:text="7" />
    
        <Button android:text="8" />
    
        <Button android:text="9" />
    
        <Button android:text="/" />
    
        <Button
            android:layout_width="wrap_content"
            android:text="." />
    
        <Button android:text="0" />
    
        <Button android:text="=" />
    
    </GridLayout>
    


  • 相关阅读:
    mpstat 查看多核CPU负载状态
    redis pipeset发布订阅
    sqlalchemyorm学生签到 成绩记录查询系统
    ORM数据库命令操作包装实例对象学习
    Python Mysql数据库操作
    redis hash操作 list列表操作
    pymysqlsqlalchemyorm
    ss命令用来显示处于活动状态的套接字信息。
    8月20日学习日志
    8月22日学习日志
  • 原文地址:https://www.cnblogs.com/AleiCui/p/11843345.html
Copyright © 2011-2022 走看看