Open ishigo1987 opened 3 years ago
Have you tried using a ScrollView
?
yes with the scrollview it will take a long time to add all these elements, and using the scrollView is counter-intuitive since the collectionView is precisely used to set the quick display of this kind of list
@ishigo1987, I have tested the snippet that you provided with Samsung A70 (Android 10) and Emulator Pixel 2 XL (Android 8.1) and it works as expected for me, or at least I couldn't reproduce any performance issue.
I see that you have flag
property in your example list that contains a path to PNG files. I suggest using relevant emoji unicodes instead. For example, if you want to use the German flag, you should click the Germany link and use the code JavaScript (JSON) & Java: \ud83c\udde9\ud83c\uddea
.
Something like this:
updateCell: (cell, index) => {
cell.find("#countryCode").only().text = '\ud83c\udde9\ud83c\uddea';
}
You can use other emojis from other sources as well.
ok thanks a lot for the advice but in our case the flags in the Json file are not used at all for the collectionView, if you saw in the updateCell I only use the countryCode key.
If you can try to do the test in a real phone and not on the emulator I think you'll see the performance problem. I'll make a video tomorrow to show you the behavior on my phone.
https://user-images.githubusercontent.com/12398336/108838456-f42bea00-75d3-11eb-8a78-01a3a2c94db5.mp4 @elshadsm in this video, you can see the slowness when i scroll the CollectionView.i use the same snippet from the biginning
Problem description
Another problem when the CollectionView columnCount property is above 2 the performance of the CollectionView drops dramatically beyond 3 it becomes almost impossible to scroll, I have the impression that the drawing of the UI elements becomes extremely slow. (Tabris 3.1 and up, )Under these conditions it's impossible to make a multi-column emoji system like Slack for example
Expected behavior
identical collectionView performances whether you have 1 columns or n+1 columns
Environment
Code snippet