Issue seems to be due to the ListView
recycle. ListView
will try to reuse the same view for the items. So in your case , newView
is called for first 6 visible items and when you scroll ListView
resizes the same 6 items views for the next 6 item in the list.
You need to update the ListView
, that you have 2 different item view, so that it know your last item views is different from others
You need to override
the getViewTypeCount
and return that you have 2 different view
@Override
public int getViewTypeCount() {
return 2; // return the view type
}
Also, override
getItemViewType
and inform ListView
that the last position view
is the one different.
Override
public int getItemViewType(int position){
int beforeLast = GameData.totalPlayers-1;
// return a unique number
if(beforeLast == position) {
return 1; // some unique id
}else {
return 0;
}
}