- item宽度不能填充满布局的原因是:adapter中刷入布局文件的时候,写成:
View v=LayoutInflater.from(context).inflate(R.layout.item_view,null);
正确的写法是:
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);
长时间不写代码,脑子真的会很懵!
View v=LayoutInflater.from(context).inflate(R.layout.item_view,null);
正确的写法是:
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);
长时间不写代码,脑子真的会很懵!