本文介绍了Android的列表视图,刷卡动作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的ListView一些文字。我想说明的刷卡动作图像(就像在Gmail应用)。例如,如果我刷卡由左到右 - 我的列表项向右移动,并且图像是从左边滑动。我的列表项可以向右移动不超过图像的宽度。刷卡停止后,列表项被移动到开始位置。我怎么能做出这样的事情?

I have listview with some text. I want to show images on swipe action (almost like in gmail app). For example, if I swipe from left to right - my list item is moving right, and image is sliding from the left. My list item can move right no more than image width. After swipe stops, list item is moving to start position. How could I make such thing?

推荐答案

看看这个

在那里,你可以看到列表视图刷卡展现意见的权利。

There you can see the listview swipe to the right to show the views.

快:

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的列表视图,刷卡动作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!