我們一般在RecyclerView清單中移除某條Item時會調用 notifyItemRemoved 方法,其還附帶了相應的移除動畫。使用雖然簡單,卻埋了一個大坑;
說了這麼多,解決辦法呢?
val list=xxxx
val postition=1
//例如移除位置position=1
notifyItemRemoved(position)
notifyItemRangeChanged(position,list.size-position)
我們一般在RecyclerView清單中移除某條Item時會調用 notifyItemRemoved 方法,其還附帶了相應的移除動畫。使用雖然簡單,卻埋了一個大坑;
val list=xxxx
val postition=1
//例如移除位置position=1
notifyItemRemoved(position)
notifyItemRangeChanged(position,list.size-position)