<分区>
我有一些文本的 ListView 。我想在滑动操作时显示图像(几乎就像在 gmail 应用程序中一样)。例如,如果我从左向右滑动 - 我的列表项向右移动,图像从左侧滑动。我的列表项可以向右移动不超过图像宽度。滑动停止后,列表项移动到起始位置。我怎么能做出这样的东西?
<分区>
我有一些文本的 ListView 。我想在滑动操作时显示图像(几乎就像在 gmail 应用程序中一样)。例如,如果我从左向右滑动 - 我的列表项向右移动,图像从左侧滑动。我的列表项可以向右移动不超过图像宽度。滑动停止后,列表项移动到起始位置。我怎么能做出这样的东西?
最佳答案
查看 this .
在那里您可以看到 ListView 向右滑动以显示 View 。
快照:
main_activity.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swipe="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.fortysevendeg.swipelistview.SwipeListView
android:id="@+id/example_swipe_lv_list"
android:listSelector="#00000000"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
swipe:swipeFrontView="@+id/front"
swipe:swipeBackView="@+id/back"
swipe:swipeDrawableChecked="@drawable/choice_selected"
swipe:swipeDrawableUnchecked="@drawable/choice_unselected"
swipe:swipeCloseAllItemsWhenMoveList="true"
swipe:swipeMode="both"
/>
</LinearLayout>
关于Android ListView ,滑动操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18386395/
相关文章:
Android Listview item长按不响应CheckBox事件
java - 如何在 ListView 的每个项目中拥有 AutoCompleteTextView
Android - 如何在 Snapchat 等 Activity 之间滑动?
java - Android - 如何在 JSON 中仅序列化扩展类的显式字段
java - 无法实例化接收器 GCMBroadcastReceiver
android - Azure AD B2C 登录 - "contains script errors preventing it from being loaded"
java - 我无法将所有数据从 firebase 获取到我的 Listview