What is the difference between the old ListView and new CollectionView in Xamarin 4?

只谈情不闲聊 提交于 2021-02-18 21:09:29

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!