错误LinearLayoutManager is already attached to a RecyclerView

错误LinearLayoutManager is already attached to a RecyclerView

 Caused by: java.lang.IllegalArgumentException: LayoutManager android.support.v7.widget.LinearLayoutManager@5bee9b3 is already attached to a RecyclerView: android.support.v7.widget.RecyclerView{f03b70 VFED..... ......I. 0,0-0,0 #7f0b0062 app:id/rv_gongshang}

错误出现情景:一个界面上我有两个横向的RecyclerView,我直接使用了同一套LayoutManager。

错误的意思是LinearLayoutManager已经被附加在一个RecyclerView上,所以猜测一个LayoutManager只能被一个RecyclerView使用,于是乎重写一个一模一样的LayoutManager,结果成功运行,也说明了我的猜测正确!

你可能感兴趣的:(错误收集)