一 . 准备工作
AndroidStudio中添加依赖:
RecyclerView的依赖:
implementation 'com.android.support:recyclerview-v7:27.0.2'
添加侧滑删除依赖:
implementation 'com.yanzhenjie:recyclerview-swipe:1.1.4'
二 . 布局
布局中使用SwipeMenuRecyclerView
<com.yanzhenjie.recyclerview.swipe.SwipeMenuRecyclerView
android:id="@+id/rv_sideslip_delete"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.yanzhenjie.recyclerview.swipe.SwipeMenuRecyclerView>