【发布时间】:2014-05-09 08:02:22
【问题描述】:
我正在使用 47 度 android 滑动列表视图 https://github.com/47deg/android-swipelistview
我将所有文件复制到我的 Eclipse 项目中并没有改变。
我在 xml 中设置了列表视图
<com.company.appname.swipe.SwipeListView
xmlns:swipe="http://schemas.android.com/apk/res-auto"
android:id="@+id/home_list_view"
android:listSelector="#00000000"
android:layout_width="match_parent"
android:layout_height="match_parent"
swipe:swipeFrontView="@id/swipelist_frontview"
swipe:swipeBackView="@id/swipelist_backview"
swipe:swipeActionLeft="reveal"
swipe:swipeActionRight="reveal"
swipe:swipeMode="both"
swipe:swipeCloseAllItemsWhenMoveList="false"
swipe:swipeOpenOnLongPress="false"
swipe:swipeAnimationTime="300"
swipe:swipeOffsetLeft="100dp"
swipe:swipeOffsetRight="0dp"
/>
我已经在代码中设置了 SwipeListView
SwipeListViewTouchListener touchListener = new SwipeListViewTouchListener(mListView, R.id.swipelist_frontview, R.id.swipelist_backview);
touchListener.resetItems();
mListView.setOnTouchListener(touchListener);
当我尝试滑动列表项时,顶视图开始滑动一秒钟然后停止(平均说 10%,但可能会根据滑动速度略有不同)。所以它被卡在那个位置。我第二次尝试滑动它时,它会平滑滚动。
注意:我每触摸一个项目,它就会暂停一次 - 但它不必是同一个项目。例如,我可以开始滑动将停止的一行,然后我可以滚动同一行或另一行,它会很流畅。
在调查中,我注意到第一次尝试滑动投掷和MotionEvent.ACTION_DOWN 事件,然后是MotionEvent.ACTION_UP 事件。第二次出现MotionEvent.ACTION_DOWN,后面跟着MotionEvent.ACTION_MOVE,后面跟着MotionEvent.ACTION_UP(所以第一次没有MotionEvent.ACTION_MOVE)
有什么想法或建议吗?
【问题讨论】:
-
我没有使用 47degrees AndroidSwipeList,但从 [tutecentral.com/android-swipe-listview/] 实现,这在我的情况下工作正常......看看那个......
-
我已经在我的项目中加入了 swipe listivew 但我没有任何问题你能发布更多代码
-
嗨@Dittimon 滚动listView 时如何管理滑动项目?因为在这里我也设置了 swipe:swipeCloseAllItemsWhenMoveList="false" 但在我的情况下,当我滚动 listview swipedlistitem 改变位置时。你是如何管理这个的。有什么方法可以管理这个吗?能否请您发布您的代码...
标签: android motionevent