//在适配器中重写
@Override
public int getViewTypeCount() {
return 4;
}
@Override
public int getItemViewType(int position) {
if (position%4==0){
return 0;
}else if (position%4==1){
return 1;
}else if (position%4==2){
return 2;
}else {
return 3;
}
//在viewholder上面写
int viewType = getItemViewType(position);
switch (viewType){
case 1:
break;
}