首页 > 解决方案 > Xamarin.Forms: CollectionView v/s ListView v/s TableView

问题描述

I want to display content of a book in my Xamarin Forms app. For the time being, I used ListView. But the ListView cannot have multiple data items bound to single row.

In ListView, I could make as below:

Sl No
Chapter
Page No

But I need the data as follows:

Sl No Chapter Page No

And I need the above header to be shown always. And the data may be furnished with backgrounds.

Now, I checked CollectionView and TableView, and I confused to choose in between.

标签: xamarin.forms

解决方案


Well as docs say, TableVies has no ItemsSource, so you have to manually insert everything. I would recommend CollectionView, it has a lot of useful stuff like aligning items vertically or horizontally and much more.

If you want header, just use CollectionView.Header (and also Footer) and play around.


推荐阅读