除了使用notifyDataSetChanged()之外,我该如何做到这一点.我想要具有notifyItemRemoved()方法的动画
解决方法 如果您尝试从RecyclerVIEw适配器中删除一个项目,并希望在RecyclerVIEw中的所有列表中显示动画.使用notifyItemRemoved(position)后使用notifyItemRangeChanged(position,getItemCount());
notifyItemRemoved(position); – notifIEs the RecyclerVIEw Adapter that data in adapter has been removed at a particular position.
notifyItemRangeChanged(position,getItemCount()); – notifIEs the RecyclerVIEw Adapter that positions of element in adapter has been
changed from position(removed element index to end of List),please
update it.
参考这个RecyclerView insert /remove animation的答案.
总结以上是内存溢出为你收集整理的android – RecyclerView onClick notifyItemRemoved不会触发onBindView全部内容,希望文章能够帮你解决android – RecyclerView onClick notifyItemRemoved不会触发onBindView所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)