custom listview adapter getView method being called multiple times, and in no coherent order

后端 未结 11 2101
情话喂你
情话喂你 2020-11-22 04:50

I have a custom list adapter:

class ResultsListAdapter extends ArrayAdapter {

in the overridden \'getView\' method I do a

11条回答
  •  不思量自难忘°
    2020-11-22 05:29

    Ques: Why Adapter calls getView() manytimes? Ans: As Listview renders on scrolling is refreshes it's view with next upcoming views, for which adapter needs to get views by calling getView().

    Ques: Why it's calls lesser if listview width and height set to fill_parent? Ans: Because as inflator has the fixed size for the screen area for list it calculates once for rendering the views onto the screen.

    Hope it will resolve your query.

提交回复
热议问题