首页 > 在RecyclerView布局使用CardView不能match_parent

在RecyclerView布局使用CardView不能match_parent


结果跑到程序里是这样的::

不能定义宽高,不能让它的宽match,怎么回事?


你的adapter,oncreateviewholder代码贴出来,看inflate的时候参数是3个不


OnCreateViewholder里这么写:
Inflater.inflate(r.layout.xxx,container,false).


之前遇过,View view = LayoutInflater.from(MainActivity.this).inflate(R.layout.content_item,parent,false); 改成这样绑定cardview就可以了,我是这么解决的,希望对你有没有帮助
http://m.blog.csdn.net/article/details?id=51108390


看下你的recyclerview的宽度设置

【热门文章】
【热门文章】