android - 在RecyclerView布局使用CardView不能match_parent
ringa_lee
ringa_lee 2017-04-17 17:26:19
0
4
682


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

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

ringa_lee
ringa_lee

ringa_lee

reply all(4)
PHPzhong

OnCreateViewholder writes:
Inflater.inflate(r.layout.xxx,container,false).

伊谢尔伦

Post your adapter and oncreateviewholder code. When you look at inflate, there are 3 parameters.

PHPzhong

Check the width setting of your recyclerview

洪涛

I have encountered it before, View view = LayoutInflater.from(MainActivity.this).inflate(R.layout.content_item,parent,false); Just change it to bind cardview like this. This is how I solved it. I hope it can be helpful to you. Not helpful
http://m.blog.csdn.net/article/details?id=51108390

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template