Kse*_*nia 0 android android-animation android-recyclerview
我有RecyclerView、ItemTouchHelper和ItemTouchHelper.Callback实例可以一起工作,并且在向左滑动时应删除应删除的所选项目(通过本教程)。移除动画有效,但只是部分有效。首先,在滑动后,该项目似乎被删除,但之后它又重新出现,并且列表保持不变:
为什么会发生呢?
确保这两条语句
cartList.remove(position);
// notify the item removed by position
// to perform recycler view delete animations
// NOTE: don't call notifyDataSetChanged()
notifyItemRemoved(position);
Run Code Online (Sandbox Code Playgroud)
正在执行。
| 归档时间: |
|
| 查看次数: |
4168 次 |
| 最近记录: |