码迷,mamicode.com
首页 > 其他好文 > 详细

GridLayout 计算器

时间:2016-04-21 23:39:42      阅读:394      评论:0      收藏:0      [点我收藏+]

标签:

技术分享
<?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

技术分享

GridLayout 计算器

标签:

原文地址:http://www.cnblogs.com/wangchuanqi/p/5419315.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!