RecyclerView的item中一个LinearLayout中包裹了一个TextView,但是TextView在RecyclerView中显示的始终是Wrap_content,始终不能显示出match_parent的效果
走同样的路,发现不同的人生
If the layout file is correct, please check whether the layout file is loaded correctly in the RecyclerView的Adapter中的onCreateViewHolder method. For example:
RecyclerView
Adapter
onCreateViewHolder
View view = mLayoutInflater.inflate(R.layout.item, parent, false);
When you inflate the child view, does the parent pass null?
Post your xml code and have a look
If the layout file is correct, please check whether the layout file is loaded correctly in the
RecyclerView
的Adapter
中的onCreateViewHolder
method. For example:When you inflate the child view, does the parent pass null?
Post your xml code and have a look