问题
I don't understand what is different in Xamarin Form by new version 4.0 between old ListView and new CollectionView. Why is better to use CollectionView?
I se help in microsoft docs, but don't se anything better.
public CollectionView ();
回答1:
The CollectionView is a flexible and performant view for presenting lists of data using different layout specifications.
BUT The ListView is an ItemsView that displays a collection of data as a vertical list.
Conclusion: if you want to display things vertically use ListView, if you want do display things with your own style use CollectionView
回答2:
ListView is a view for presenting lists of data, especially long lists that require scrolling. The CollectionView is a flexible and performant view for presenting lists of data using different layout specifications.
CollectionView is a view for presenting lists of data using different layout specifications. It aims to provide a more flexible, and performant alternative to ListView. For more information, see Xamarin.Forms CollectionView.
来源:https://stackoverflow.com/questions/56268458/what-is-the-difference-between-the-old-listview-and-new-collectionview-in-xamari