最近使用RecyclerView 每次绘制的item 虽然写的是填充父控件,但是每次效果都是包裹内容。没有填满手机屏幕
解决方法:
将: LayoutInflater.from(context).inflate(R.layout.home_page_itme, null);
改成: LayoutInflater.from(context).inflate(R.layout.home_page_itme, parent,false);
![](https://img.haomeiwen.com/i1981845/b68dc2ca380dce44.png)
事情的原因:
有时间再把原理补上~
最近使用RecyclerView 每次绘制的item 虽然写的是填充父控件,但是每次效果都是包裹内容。没有填满手机屏幕
解决方法:
将: LayoutInflater.from(context).inflate(R.layout.home_page_itme, null);
改成: LayoutInflater.from(context).inflate(R.layout.home_page_itme, parent,false);
事情的原因:
有时间再把原理补上~
本文标题:RecyclerView item 宽度没有填充屏幕
本文链接:https://www.haomeiwen.com/subject/qyhfvttx.html
网友评论