答案 0 :(得分:1)
在BaseAdapter中执行此操作。
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = null;
if(position%2 != 0) {
view = layoutInflater.inflate(R.layout.view_1, null, true);
// Do action for view 1
}
else{
view = layoutInflater.inflate(R.layout.view_2, null, true);
// Do action for view 2
}
return view;
}