我有自定义Adapter
,ListView
其中包含不同Layout
的ListView
. 的选择Layout
取决于getitemType
我选择Layout
文件。但是当我滚动这些项目时占据我的屏幕的前三个项目正在重复,直到我的列表大小但位置值发生变化。
View getView(final int position, View convertView, ViewGroup parent)
{
case TYPE_MENUUPLOAD:
case TYPE_UPLOADIMAGE:
ViewHolder holder4 = null;
if (convertView == null)
{
holder4 = new ViewHolder();
convertView=Inflater.inflate(R.layout.uploadphoto,null);
convertView.setTag(holder4);
} else
{
holder4 = (ViewHolder)convertView.getTag();
}
return convertView;
case TYPE_USER:
ViewHolder holder5 = null;
if (convertView == null)
{
holder5 = new ViewHolder();
convertView = Inflater.inflate(R.layout.user, null);
convertView.setTag(holder5);
} else
{
holder5 = (ViewHolder)convertView.getTag();
}
return convertView;
case TYPE_UPLOADVIDEO:
ViewHolder holder6 = null;
if (convertView == null)
{
holder6 = new ViewHolder();
convertView = mInflater.inflate(R.layout.uploadvideo, null);
convertView.setTag(holder6);
}
else
{
holder6 = (ViewHolder)convertView.getTag();
}return convertView;
};