Android,GridLayout布局(简易计算器)
2015-09-16 16:39
387 查看
<?xml version="1.0" encoding="utf-8"?> <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:rowCount="5" android:columnCount="4" > <Button android:id="@+id/one" android:text="1"/> <Button android:id="@+id/two" android:text="2"/> <Button android:id="@+id/three" android:text="3"/> <Button android:id="@+id/devide" android:text="/"/> <Button android:id="@+id/four" android:text="4"/> <Button android:id="@+id/five" android:text="5"/> <Button android:id="@+id/six" android:text="6"/> <Button android:id="@+id/multiply" android:text="×"/> <Button android:id="@+id/seven" android:text="7"/> <Button android:id="@+id/eight" android:text="8"/> <Button android:id="@+id/nine" android:text="9"/> <Button android:id="@+id/minus" android:text="-"/> <Button android:id="@+id/zero" android:layout_columnSpan="2" android:layout_gravity="fill" android:text="0"/> <Button android:id="@+id/point" android:text="."/> <Button android:id="@+id/plus" android:layout_rowSpan="2" android:layout_gravity="fill" android:text="+"/> <Button android:id="@+id/equal" android:layout_columnSpan="3" android:layout_gravity="fill" android:text="="/> </GridLayout>
相关文章推荐
- android OOM(out of memory)异常的处理
- Android:动画系统
- Android清除本地数据缓存
- Android:都是Layout的BaselineAligned惹的祸
- android .9图片的制作
- android 内部缓存器(手机自带的存储空间中的当前包文件的路径)
- onActivityResult(),startActivityForResult()的使用
- Android 通知栏
- Android学习笔记之——ListView 的两种适配器ArrayAdapter和SimpleAdapter
- Android开发中那些你不知道的事
- Android学习笔记之——DatePicker&TimePicker
- Android DiskLruCache完全解析,硬盘缓存的最佳方案
- Android Canvas Layers
- Retrofit – Java(Android) 的REST 接口封装类库
- Android 开发总结
- android模拟器的判定
- Android开发学习笔记:浅谈显示Intent和隐式Intent
- Java-->Android 直连 Ms Sql Server 2008数据库
- Android:res之selector背景选择器
- NDK基本开发及适用场景