ListView Performance Issue

Hey,
when I try to create a ListView with around 200 items, the ListViewer is stucking for a few seconds, each time I’m scrolling, due to the amount of items.

I already tried to create a VerticalScrollArrangement and put the ListView into it. Then I set the height of the ListView to the actual height of each item combined, using these blocks:


The result of this was, the screen is loading a long time each time I’m opening it.

Does someone have a alternative way or a solution for my problem?

Try setting the height to Automatic.

This sets the height of the ListView to the height of a single item (4% in my case)

Why dont you use the Item height in percent property?
You use current height for complete listview and Not for item

The listview is already scrollable. So, I think you don’t need the Vertical Scroll Arrangement. (And that may be reason , why it gets stuck during scrolling)

Try to put the Listview in simple Vertical arrangement instead.

@Mika
I don’t want to change the item height. I just want a smooth ListView with around ~200 items.

@Vaibhav
The ListView is in a scroll arrangement cause there are other components above it. I want to hide these, once the user started scrolling in the List View. It is also lagging, when it is in scrollable. In VerticalScrollArrangement it has smooth scroll Animation, but it takes time to load once I set the arrangement visible.

What I’m looking for is a way to async load the items. Maybe a extension or a alternative to listView could help me?

You can load every single items with a timer. I mean set a list to listview elements, when the timer fires, you append the neyt item to list.

I managed to solve my problem. Thanks to everyone who tried to help me! :slight_smile:

I will post my solution tomorrow.

2 Likes

So, what was it?

I did never have a list view with more than 20 options, now I am gonna have one that may have hundreds and I am worried that it may have performance issues. Searching for this I found your topic. I guess your solution may be useful if I (and others) have the same problem.

First of all, I should mention, that I used ColinTree’s free custom ListView Extension. But you only need this if you are using ListView without images. Otherwise you can use the given ListView with pictures.

So here is my solution:

1st: Set the ListView height to ItemHeight×LengthOfList
(Height in % is: Screen1.heightx0.04 <- This would be 4%)

2nd: Make a clock which adds all items 1 by 1.
This is why you need the extension. The normal ListView doesn’t have a feature to add items (only to overwrite the whole list with a new item).

This solution may take a while (few seconds with ~200 items), but the app doesn’t freeze and the List is loading while you can watch/use it.

Hope I could help you!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.