ListView Changing Items During Scroll

后端 未结 5 408
野性不改
野性不改 2021-01-13 15:05

I am implementing a ListFragment using a custom ArrayAdapter to populate the list. Each row item has an ImageView and three TextViews. Data is being parsed via XML and the i

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-13 15:36

    Just add these lines of code in your adapter class.

    @Override
    public int getViewTypeCount() {
    
        if (getCount() != 0)
            return getCount();
    
        return 1;
    }
    

    Hope it will solve your problem.

提交回复
热议问题