Android recyclerview 只显示一行 宽度不适配

最近学习recyclerview 遇到的问题

1.宽度不适配

正确写法

LayoutInflater.from(context).inflate(R.layout.item_view,parent,false);

错误写法

LayoutInflater.from(context).inflate(R.layout.item_view,null);

2 只显示一行

itemView中父 view  写成wrap_content ;

原文地址:https://www.cnblogs.com/zhujiabin/p/9045416.html