android计算器布局界面――基础编
16lz
2021-01-23
计算器布局,是初学者学习的过程,下面让我们看看它的界面是如何的。
main.xml代码
- <?xmlversion="1.0"encoding="utf-8"?>
- <TableLayoutxmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <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="0"/>
- <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>
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/hello"
- />
- </TableLayout>
更多相关文章
- android计算器原创【安卓进化三】
- 完全的安卓初学者的NDK开发——几点注意
- Android 计算器解析(一): 建立简单界面
- Android核心分析28篇,强烈推荐android初学者
- Android初学者的一些学习网址
- Android自做小实验之 计算器
- Android实现计算器布局(四种布局方式)之LinearLayout线性布局
- Android初学者冷知识
- Android初学者