条目1:
if (convertView == null || !convertView.getTag(R.id.tag_list_item_type).toString().equals("1")){
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_advert_img, null, false);
convertView.setTag(R.id.tag_list_item_type,"1");
}
条目2:
if (convertView == null || !convertView.getTag(R.id.tag_list_item_type).toString().equals("2")){
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_advert_txt, null, false);
convertView.setTag(R.id.tag_list_item_type,"2");
}
tag:
在attrs文件中声明:
<item type="id" name="tag_list_item_type"/>
01-03
160
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-17
2366
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交