记账本开发流程:
对于一个记账本的初步开发而言,我实现的功能有:
①实现一个记账本的页面
②可以添加数据并更新到页面中
③可以将数据信息以图表的形式展现
(一)首先,制作一个记账本的页面。
①在系统自动创建的content_main.xml文件中添加listview
android:id="@+id/lv_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
②创建一个list_item.xml来实现见记账本的页面布局,一共需要三个组件,一个是记账信息,记账时间,记账金额
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="vertical">
android:id="@+id/tv_title"
android:layout_width="150dp"
android:layout_height="80dp"
android:layout_marginLeft="10dp"
android:layout_alignParentLeft="true"
android:gravity="center"
android:singleLine="true"
android:textSize="35sp"
android:text="costTitle"
android:ellipsize="marquee" />
android:id="@+id/tv_date"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:layout_toRightOf="@+id/tv_title"
android:layout_marginLeft="15dp"
android:textSize="20sp"
android:gravity="center"
android:text="costDate"/>
android:id="@+id/tv_cost"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:text="30"
android:textSize="30sp"
android:layout_marginRig

本文介绍了一个安卓记账本App的初步开发过程,包括创建记账本页面,添加数据展示,以及数据库操作。通过在content_main.xml中添加ListView,创建list_item.xml布局,编写适配器CostListAdapter,实现数据存储的CostBean类,以及数据库操作类DatabaseHelper,完成了基本功能的搭建。后续将开发添加页面和图表显示。
最低0.47元/天 解锁文章
1875

被折叠的 条评论
为什么被折叠?



