Android solves the problem of white space in ListView when ListView uses multiple la S and uses convertView for caching.
When using ListView, using convertView In the Adapter will improve the performance of ListView by 100%? But today we found that while loading different views at the same time in the listView, there will be a blank space at the bottom of the ListView. It may happen that this may be caused by loading several different views, the system cannot accurately calculate the total height of the ListView because their heights are different and their quantities are different.
Two callback functions are provided in BaseAdapter to specify the layout and the layout corresponding to position.
@ Overridepublic int getViewTypeCount () {return 2 ;}@ Overridepublic int getItemViewType (int position) {if (getSectionForPosition (position) = 0) {return TYPE_1 ;} else {return TYPE_2 ;}}
Simply rewrite it to solve the problem.