Implement ListView and CollectionView comparison
I decided to replicate a PoC Playstation Network trophy app that I wrote a while back as it is a good example of ListView usage.
Screenshots
| List View | CollectionView |
|---|---|
![]() |
![]() |
What went well?
Overall it was very straightforward to replicate the same page using a CollectionView instead of a ListView. As you can see from the screenshots, the way that the layouts are rendered appears identical.
What didn't go well?
The only problem that I ran into was that I initially tried to reuse the ViewCell that I created for the ListView with the CollectionView, reading through the documentation didn't seem to mention that you can't use a ViewCell as the root element for the CollectionView DataTemplate - I imagine you could get around this by using a ContentView as the root element in the layout though (I have not tried this though), this would then allow layouts to be written as reusable cells.
How is the performance?
Running on an x86_64 Android 9.0 emulator everything was a little sluggish and juddery when scrolling, but that could just be the emulator. When running on a device both the ListView and CollectionView were both very smooth when scrolling with a small occasional judder.
One thing that I did see with the ListView, but not with CollectionView, was that when scrolling down then scrolling back up again some controls within the ViewCell would disappear or be resized so their content was not displayed properly - this only seemed to affect labels and is not something I have seen when using Xamarin.Forms 3.x.
Missing or Desired Things:
I know some of these are either currently being worked on or are planned:
- Pull-to-Refresh
- Header / HeaderTemplate
- Footer / FooterTemplate
- Grouping doesn't seem to be possible
- Item appearing/disappearing events
- Scroll bar visibility
- Separators
- Visibility
- Colour
- Full width capability for iOS
- Caching Strategy - It's not clear what the behaviour for each platform is.
- Ability to use a
ViewCellas the item template.
Swag Time!
Take a minute now or later and provide your info here: https://www.surveymonkey.com/r/WKBZCXX
@chowarth Thanks for your contribution and feedback. I don't belive we have any interest in making the use of ViewCells a part of CollectionView in any way, as a main goal of CollectionView is to get rid of Cell use entirely. I will take note of the feedback though for our internal discussions regarding reusability and caching. Many other features like pull-to-refresh and the header/footer are planned.

