android tablelayout 点击,Android攻城狮的第一门课-简易计算器的布局,用tablelayout实现...

写得比较粗糙,请见谅。

android:layout_width="match_parent"

android:layout_height="match_parent"

android:stretchColumns="*" >

android:layout_weight="1"

android:gravity="rightcenter_vertical"

android:background="#f0f0f0"

android:id="@+id/input"

android:layout_width="wrap_content"

android:layout_height="40dp"

android:editable="false"

android:textSize="30dp"

/>

android:layout_weight="1"

android:id="@+id/tableRow1"

android:layout_width="wrap_content"

android:layout_height="wrap_content" >

android:id="@+id/7hao"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="7" />

android:id="@+id/8hao"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="8" />

android:id="@+id/9hao"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="9" />

android:id="@+id/chu"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="/" />

android:layout_weight="1"

android:id="@+id/tableRow2"

android:layout_width="wrap_content"

android:layout_height="wrap_content" >

android:id="@+id/4hao"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="4" />

android:id="@+id/5hao"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="5" />

android:id="@+id/6hao"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="6" />

android:id="@+id/cheng"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="*" />

android:layout_weight="1"

android:id="@+id/tableRow3"

android:layout_width="wrap_content"

android:layout_height="wrap_content" >

android:id="@+id/1hao"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="1" />

android:id="@+id/2hao"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="2" />

android:id="@+id/3hao"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="3" />

android:id="@+id/jian"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="—" />

android:layout_weight="1"

android:id="@+id/tableRow4"

android:layout_width="wrap_content"

android:layout_height="wrap_content" >

android:id="@+id/xiaoshudian"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="." />

android:id="@+id/0hao"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="0" />

android:id="@+id/jia"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="+" />

android:id="@+id/del"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="DEL"

/>

android:layout_weight="1"

android:id="@+id/tableRow5"

android:layout_width="wrap_content"

android:layout_height="wrap_content" >

android:id="@+id/dengyu"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="="

android:background="#FF6100"

android:layout_span="3"/>

android:id="@+id/clear"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="CLEAR" />

```
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值