###问题
RecyclerView显示Item布局错乱、不一致解决办法,xml预览效果和实际运行相差很大
###解决:
Adapter中改:
View view = View.inflat(context,R.layout.item,null)
为
LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate(R.layout.item,parent,flase);
//注意false
###原因说明:
[RecyclerView显示Item不一致解决办法](http://www.jb51.net/article/117794.htm)
本文介绍了当RecyclerView显示Item布局错乱或不一致时的解决办法。通过更改Adapter中的代码,使用LayoutInflater从context中inflate指定的Item布局资源,并确保其附加到父视图时参数正确设置为false。
3018

被折叠的 条评论
为什么被折叠?



