What is “convertView” parameter in ArrayAdapter getView() method

前端 未结 1 644
小蘑菇
小蘑菇 2020-12-13 01:59

Can someone tell me what the convertView parameter is used for in the getView() method of the Adapter class?

Here is a sample

相关标签:
1条回答
  • 2020-12-13 02:52

    You shouldn't be calling that method by yourself.

    Android's ListView uses an Adapter to fill itself with Views. When the ListView is shown, it starts calling getView() to populate itself. When the user scrolls a new view should be created, so for performance the ListView sends the Adapter an old view that it's not used any more in the convertView param.

    0 讨论(0)
提交回复
热议问题