android notifyItemRangeInserted disable autoscroll

后端 未结 1 1680
青春惊慌失措
青春惊慌失措 2020-12-29 06:03

I\'m using RecyclerView as the base for my data list. i\'ve implemented custom RecyclerView.Adapter which is based on ArraList. on fetching data from the internet the code t

1条回答
  •  伪装坚强ぢ
    2020-12-29 06:12

    Problem is in your positionStart. Should be:

    public void addItems(List items){    
        final int positionStart = data.size() + 1;
        data.addAll(items);
        notifyItemRangeInserted(positionStart, items.size());
    }
    

    0 讨论(0)
提交回复
热议问题