Question

Imagine you have a full screen ListView, with cells roughly the size of the screen, and 100s of cells.

In fact, I notice ListView "keeps alive" about five of the cells...

(Let's say, roughly 1 or 2 on screen and 1 or 2 up and down offscreen.)

Quite simply, can you change this "setting" to say 20? Can you force ListView to be "more ready" when you scroll -- that is to say, to "recycle less"?

What's the situation? Or should I just write my own cell recycling handler? (As you sometimes do on iOS.)

Note that, essentially - say you made the "view" of the ListView perhaps 5x or 10x as high as the Actual Screen. (And then the "real" screen was in the middle of that.) In fact, that would do just what I describe. It would have more cells "ready" all the time. In fact, can yo do that? (Perhaps that's trivial, I don't know.) Or is ListView only trigger strictly by the "real, genuine" screen? Can you "trick" it somehow in to thinking the screen is 5x higher than it is?

Cheers

Was it helpful?

Solution

I dont think you can do that in android. That is because items will get recycled when they are off screen.

OTHER TIPS

I think ViewPager suits your situation better, instead of ListView. You can take a look at this questions for vertical implementation of ViewPager.

https://stackoverflow.com/questions/14889530/vertical-viewpager-implementation

Android: Vertical ViewPager

Then you can just use public void setOffscreenPageLimit (int limit) method to set how many views you want to "keep alive".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top