2种解决情况:
1:

将图中位置:
LayoutInflater.from(context).inflate(R.layout.home_page_itme, null);
或者
LayoutInflater.from(context).inflate(R.layout.home_page_itme, null,false);或者别的什么。
改成:
LayoutInflater.from(context).inflate(R.layout.home_page_itme, parent,false);
2:
在item布局外面嵌套一层RelativeLayout:

这应该会解决99%的该类问题,解决方案来自网络。
本文提供两种有效解决AdapterView在数据绑定时遇到的问题的方法。第一种是在inflate方法中正确指定父视图参数,第二种是在item布局外使用RelativeLayout进行包裹。这两种方案能够解决大多数此类问题。
1543





