question

iubns avatar image
0 Votes"
iubns asked LeonLu-MSFT commented

Performance according to the number of controls within the CollectionView

Hello, we are developing with xamarin.forms.

Currently, we are creating a layout in which a list of cards comes out and there is a list (different number for each card) in that card.

When I actually bound the data and checked it on the device, the speed was too slow and there was a scrolling cycle.

The number of cards is about 10-20, and the number of cards inside is similar to 10-20.

In addition, there are stack layouts in the list and 4~5 controls such as label and boxview exist.

As a result, each card has about 40 to 200 controls.
For the entire list, you will have 400 to 2000 units.

The card consists of CollectionView, and the list inside the card is flexLayout.

I looked at the profiling and it seems that only the cards that appear on the screen when scrolling are created when collectionView is displayed on the screen, and when one card is created, about 400 objects (controls) are created, memory becomes high and GC works.

As a result, GC turns around and shows how the UI stumbles. Also, cards that are far from the screen disappear again, so when I scroll again, it slows down again.

Because of this phenomenon, I get stuck in every scroll, is there any good solution?

In addition, it seems difficult to reduce the number of controls in the current situation.

You will also see four to six cards per screen.

dotnet-xamarin
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Could you share your layout code? Based on your description, do you put the collectionview to listview items? If so, please do not do that. It will make focus conflict. If you have lots of control in one item, you can make two pages to display it(like master-details page's design),

0 Votes 0 ·

0 Answers