RecyclerRefresh
RecyclerRefresh copied to clipboard
初始数据getData()个数太少时,再次刷新不会删除footer
例如i < 2
/**
* 获取测试数据
*/
private void getData() {
for (int i = 0; i < 2; i++) {
Map<String, Object> map = new HashMap<>();
data.add(map);
}
adapter.notifyDataSetChanged();
swipeRefreshLayout.setRefreshing(false);
adapter.notifyItemRemoved(adapter.getItemCount());
}
@WaylanPunch @leoleohan 确实有这个问题,Google了一下,还是没弄明白。比如i < 2,为啥刷新的时候notifyItemRemoved无效,但是刚进入页面的时候notifyItemRemoved有效的 :|
应该加个判断,让数据超出屏幕才对footer进行操作