没有合适的资源?快使用搜索试试~ 我知道了~
前言:项目中经常会用到类似于QQ侧滑点击删除的效果,网上的开源库也很多。个人感觉SwipeLayout最好用。下面介绍怎么使用。 一、首先导入需要的Jar包,有3个,AndroidSwipeLayout-v1.1.8.jar、AndroidViewAnimations-1.1.3.jar、nineoldandroids-2.4.0.jar。第一个jar包就是我们使用该控件的jar包,后面2个是侧滑出现删除menu的动画所需的jar包。下面就是怎么使用了。 主布局的xml文件如下,就是一个ListView: <?xml version=1.0 encoding=utf-8?> <Lin
资源推荐
资源详情
资源评论
非常实用的侧滑删除控件非常实用的侧滑删除控件SwipeLayout
前言:项目中经常会用到类似于QQ侧滑点击删除的效果,网上的开源库也很多。个人感觉SwipeLayout最好用。下面介绍怎
么使用。
一、首先导入需要的Jar包,有3个,AndroidSwipeLayout-v1.1.8.jar、AndroidViewAnimations-1.1.3.jar、nineoldandroids-
2.4.0.jar。第一个jar包就是我们使用该控件的jar包,后面2个是侧滑出现删除menu的动画所需的jar包。下面就是怎么使用
了。
主布局的xml文件如下,就是一个ListView:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/swipe_listview"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
</LinearLayout>
listview中的每个Item的布局如下:
<?xml version="1.0" encoding="utf-8"?>
<com.daimajia.swipe.SwipeLayout xmlns:swipe="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="#FF5534"
android:gravity="center"
android:tag="Bottom3"
android:weightSum="10" >
<ImageView
android:id="@+id/trash"
android:layout_width="27dp"
android:layout_height="30dp"
android:layout_weight="1"
android:src="@drawable/trash" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text="Delete Item?"
android:textColor="#fff"
android:textSize="17sp" />
<Button
android:id="@+id/delete"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="4"
android:background="@drawable/white"
android:text="Yes,Delete"
android:textColor="#FF5534" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
资源评论
weixin_38592847
- 粉丝: 8
- 资源: 874
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功