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

后端 未结 11 2253
情话喂你
情话喂你 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:40

    I am having the same issue. If I have height set to fill_parent, then I get "usually" 2 calls per row. But, if I set height of my ListView to exact value, let's say to 300dp, then I get exactly one GetView call per row.

    So, it seems to me that the only way is to first determine height of the screen, then programmatically set height of listvilew to that value. I don't like it. I hope there is a better way.

提交回复
热议问题