RecyclerView:java.lang.IndexOutOfBoundsException: Invalid item position

来源:互联网 发布:淘宝美工和ui设计师 编辑:程序博客网 时间:2024/06/07 03:16

自定义LayoutManager,在supportsPredictiveItemAnimations 方法中返回false,下面以自定义LinearLayoutManager为例:

public class ProLinearLayoutManager extends LinearLayoutManager{    public ProLinearLayoutManager(Context context) {        super(context);    }    public ProLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {        super(context, orientation, reverseLayout);    }    public ProLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {        super(context, attrs, defStyleAttr, defStyleRes);    }    @Override    public boolean supportsPredictiveItemAnimations() {        return false;    }}
阅读全文
0 0
原创粉丝点击