GridLayout----计算器
来源:互联网 发布:淘宝彩票是真的吗 编辑:程序博客网 时间:2024/05/17 20:29
• step 1:先定义组件的对其方式 android:orientation 水平或者竖直,设置多少行与多少列z
• step 2:设置组件所在的行或者列,记得是从0开始算的,不设置默认每个组件占一行一列
• step 3:设置组件横跨几行或者几列;设置完毕后,需要在设置一个填充:android:layout_gravity = “fill”
< ?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>
阅读全文
0 0
- 计算器。。。GridLayout
- GridLayout----计算器
- Android GridLayout简介,以计算器为例
- Android,GridLayout布局(简易计算器)
- AndroidUi--用GridLayout实现计算器界面
- AndroidUi--用GridLayout实现计算器界面
- GridLayout
- GridLayout
- gridlayout
- GridLayout
- GridLayout
- GridLayout
- gridlayout
- GridLayout
- GridLayout
- gridlayout
- GridLayout
- GridLayout
- 对于Recyclerview的item一些的简单操作
- eclipse maven项目有红叉 但里面没错
- A Wyckoff Bar-by-Bar Analysis Example
- 1
- [LeetCode-Algorithms-12] "Integer to Roman" (2017.10.2-WEEK5)
- GridLayout----计算器
- 指针的大小到底是由谁决定?是多少?
- NOI 1.13 15:求序列中的众数
- Android Donut Makefile 分析之二 (build/envsetup.sh)
- 数据库索引到底是什么,是怎样工作的?
- Windows安装Oracle 11g后开机变慢的解决方法
- 第一课、 走进C
- python dict json读写文件
- [Java]String和StringBuffer连接字串的效率比较