I want the last cell to have for example 300dp height. Here is my getView method
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View rowView = convertView;
if (rowView == null) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
rowView = inflater.inflate(R.layout.item_card_list, parent, false);
}
if (position == getCount() - 1) {
ViewGroup.LayoutParams layoutParams = rowView.getLayoutParams();
layoutParams.height = 300;
rowView.setLayoutParams(layoutParams);
}
return rowView;
}
I want the last cell to have 300dp height. It works good, last cell have 300dp height, when I'a scroll to bottom. But when I scroll up, appears, that a lot of other elements of list become 300dp in height.