Jacob
Jacob

Reputation: 37

Slow listview scrolling problem

Got a little ListView problem here. I've got a ListView that goes like

TextView
ImageView
TextView
ImageView
TextView
...

and so on. It has 1000+ items in it, resulting in scrolling being really slow. I tried to improve the performance as advised here and the overall scrolling performance really improved A LOT.

However, another problem appeared - after a certain amount of scrolling (usually almost right away), the views start "clustering", what used to be ImageView-TextView-ImageView turns to ImageView-ImageView-TextView and so on.

Any ideas what could be wrong? Thanks in advance for any help!

(P. S. A wild guess - I needed to make the ListView circular (Imagine it as a wheel-of-fortune-like list) and thus overrode the getCount to return hardcoded values and getItem to return position % number of items. Could that have anything to do with it?)

Upvotes: 3

Views: 1566

Answers (1)

hauns
hauns

Reputation: 116

when the images have a logical connection to the texts a possible approach would be to aggregate each pair into one element and change the adapter accordingly.

Upvotes: 2

Related Questions