一个简单的仿IOS的列表项滑动菜单(也不知道怎么描述比较好)。
顺手做出来的小东西,就分享给大家了。
仿iOS列表项滑动菜单:
1、滑动出现菜单,越界阻尼效果;
2、删除列表项效果。
GitHub地址:
https://github.com/zarics/ListItemMenu
1.[代码]布局示例代码(其他代码见Github)
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:id="@+id/delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="删除"
android:textColor="#ffffffff"
android:textSize="20sp"
android:background="#ffcc2500"/>
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="信息"
android:textColor="#ffffffff"
android:textSize="20sp"
android:background="#ff308dff"/>
android:id="@+id/item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:textSize="20sp"
android:background="#ffffff"/>