列表条目左滑显示删除按钮的控件有很多,可以说是已经很常见了,不过下面这种效果的应该不常见,类似iOS11的但又有一点细节的差异,和iOS版微信首页列表的差不多。

使用: itemView的布局文件仿照下面即可
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/itemVisibleFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/default_selector_recycler_item"
android:focusable="true"
android:clickable="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"</

这篇博客介绍了如何创建一个类似于iOS11风格,但又有细微差异的列表条目左滑菜单,其效果接近于iOS版微信首页的体验。通过自定义itemView的布局文件,你可以轻松实现这个功能。项目源码可在lzls/SwipeMenuRecyclerView找到。
最低0.47元/天 解锁文章
607

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



