mav*_*oid 4 android cursor android-recyclerview
如何在swapCursor函数中实现Recycler View默认项目添加/删除动画.notifyDataSetChanged()不会显示任何动画.
public void swapCursor(Cursor newCursor) {
mCursor = newCursor;
notifyDataSetChanged();
}
Run Code Online (Sandbox Code Playgroud)
Ani*_*dan 10
只需在活动中设置以下内容,
recyclerView.setHasFixedSize(true);
Run Code Online (Sandbox Code Playgroud)
在适配器中,写
setHasStableIds(true); //in constructor
@Override
public long getItemId(int position) {
return cameraImageArrayList.get(position).hashCode(); //Any unique id
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1403 次 |
| 最近记录: |