我试图在每n行后在列表视图中返回横幅
我得到了它,但是当我向下滚动时,列表变得扭曲并且行开始重叠。广告横幅开始浮动列表。
public View getView(final int position, View convertView, ViewGroup parent) {
View row = convertView;
RestHolder holder = null;
boolean showAd = proVersion == false
&& (position == 3 || (position % 6 == 0 && position != 0 && position != 6));
if (showAd) {
if (row instanceof Banner) {
return row;
} else {
//declared startAppBanner in the constructor
return startAppBanner;
}
}
if (row == null || row instanceof Banner) {
System.err.println("### notusing row");
LayoutInflater inflater = ((SherlockActivity) context)
.getLayoutInflater();
row = inflater.inflate(viewResourceId, parent, false);
....