使用表格布局实现界面计算器按钮
来源:互联网 发布:武汉有mac专柜吗 编辑:程序博客网 时间:2024/05/09 11:38
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="0,1,2,3"//设置可调宽度的列的序号,从0开始
tools:context=".Addressbook" >
<TableRow>
<Button
android:layout_width="wrap_content"//有内容设置宽度
android:layout_height="wrap_content"//有内容设置高度
android:text="C"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="---"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="/"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="*"
/>
</TableRow>
<TableRow>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
/>
</TableRow>
<TableRow>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="4"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+"
/>
</TableRow>
<TableRow>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="."
/>
</TableRow>
<TableRow>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="( )"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="2"//合并2列
android:text="="
/>
</TableRow>
</TableLayout>
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="0,1,2,3"//设置可调宽度的列的序号,从0开始
tools:context=".Addressbook" >
<TableRow>
<Button
android:layout_width="wrap_content"//有内容设置宽度
android:layout_height="wrap_content"//有内容设置高度
android:text="C"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="---"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="/"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="*"
/>
</TableRow>
<TableRow>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
/>
</TableRow>
<TableRow>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="4"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+"
/>
</TableRow>
<TableRow>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="."
/>
</TableRow>
<TableRow>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="( )"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="2"//合并2列
android:text="="
/>
</TableRow>
</TableLayout>
0 0
- 使用表格布局实现界面计算器按钮
- 表格布局:使用表格布局实现如下界面的设计
- 从零开始学android<使用嵌套布局实现计算器界面.十七.>
- Java按钮控件数组实现计算器界面
- 按钮控件数组实现计算器界面
- 表格布局—计算器
- Android Studio 表格布局实现登录界面
- 计算器界面-布局
- Android计算器界面布局
- 使用css实现表格布局
- 表格布局器练习--计算器
- Android实现计算器布局(四种布局方式)之TableLayout表格布局
- UI界面-表格布局
- PyQt5学习教程9:使用Grid Layout布局计算器界面
- 运用布局构建计算器界面
- 安卓布局计算器界面
- 使用html表格布局做一个企业邮箱登录界面
- UILabel 实现计算器界面
- Windows Phone正在死去
- HDU 1978 How many ways(记忆化)
- 使用ORACLE STREAM STRMMON 监控工具
- DP总结
- 英语学习网站
- 使用表格布局实现界面计算器按钮
- 第一套四
- SCIP 学习笔记 第一章
- PreparedStatement接口
- [POJ 2728]Desert King
- oracle授权
- tyvj p1002- 谁拿了最多奖学金[模拟]
- hdu1201
- nginx缓存设置