Android Studio--家庭记账本(二)
2024-10-09 12:17:45
家庭记账本APP目前实现了记账功能,也就是说增加功能,今天打算添加删除功能,参考着增加的代码研究,从网上查阅资料,打算实现左滑删除功能,目前学到了xml里面的HorizontalScrollView布局,可以将删除按钮隐藏在最右侧,左滑可以将其显现出来
<?xml version="1.0" encoding="utf-8"?> <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="80dp"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"> <TextView
android:id="@+id/tv_title"
android:layout_width="150dp"
android:layout_height="80dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dp"
android:ellipsize="marquee"
android:gravity="center"
android:singleLine="true"
android:text="costTitle"
android:textSize="35sp" /> <TextView
android:id="@+id/tv_date"
android:layout_width="100dp"
android:layout_height="80dp"
android:layout_marginLeft="15dp"
android:layout_toRightOf="@+id/tv_title"
android:gravity="center"
android:text="costDate"
android:textSize="20sp" /> <TextView
android:id="@+id/tv_cost"
android:layout_width="100dp"
android:layout_height="80dp"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:gravity="center"
android:text="30"
android:textSize="30sp" /> <TextView
android:id="@+id/tv_delete"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="delete"/>
</LinearLayout>
</HorizontalScrollView>
但这仅仅是前端显示了出来,删除功能的实现还是不行。
最新文章
- 谈谈document.ready和window.onload的区别
- SQL开发技巧(二)
- 如何开发一款堪比APP的微信小程序(腾讯内部团队分享)
- swiper 内容超出纵向滚动 解决办法
- Button 对 TreeView1 所有节点的全选
- mssql的delete用用到被delete的表的别名
- 暑假集训(1)第七弹 -----Oil Deposits(Poj1562)
- C语言:类似linux内核的分等级DEBUG宏(打印宏)
- window.open()具体解释及浏览器兼容性问题
- VMware Player安装centos
- 连接池报错 Proxool Provider unable to load JAXP configurator file: proxool.xml
- 前端笔记之JavaScript(六)让人头疼的正则表达式
- spring异常Unsatisfied dependency expressed through constructor parameter 0
- C# DataTable 转 实体类
- OAuth2.0的原理介绍
- Nginx中防盗链(下载防盗链和图片防盗链)及图片访问地址操作记录
- jsp配置文件数据信息读取
- js调试系列: 初识控制台
- usb_control_msg函数用法和说明
- 【BZOJ】3751: [NOIP2014]解方程【秦九韶公式】【大整数取模技巧】