【发布时间】:2016-07-08 17:06:44
【问题描述】:
我有一个 recyclerview 列表,里面有这样的项目:
红色方块只能向左滑动(拖放),绿色只能向右滑动。当元素被滑动时,出现并带有如下选项的图像:
-向左滑动:
布局项具有这样的外观:
<RelativeLayout>
<LinearLayout>
<ImageView/> //Red square
<ImageView/> //Green square
</LinearLayout>
<LinearLayout>
<ImageView/> //Red square swiped action
<ImageView/> //Green square swiped action
</LinearLayout>
</RelativeLayout>
我正在尝试使用 ItemTouchHelper.Callback 执行此操作,并覆盖方法 onChildDraw 以制作正确的动画。但我不能用方形已经刷卡,并做出正确的动画。
¿ 实现这一目标的另一种方法?
【问题讨论】:
标签: android android-recyclerview swipe itemtouchhelper