at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:1764)

来源:互联网 发布:无基础学编程看什么书 编辑:程序博客网 时间:2024/05/18 18:02

异常:

java.lang.NullPoinat android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:1764)

方案:

I got this error when my RecyclerView had no LayoutManager. Adding this code fixed the problem:

recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));

0 1
原创粉丝点击