roubachof / Sharpnado.CollectionView

A performant list view supporting: grid, horizontal and vertical layout, drag and drop, and reveal animations.
The Unlicense
244 stars 30 forks source link

[Question] How to set HasUnvenRow=true or SizingTechnique=MeasureAllItem for Vertical CollectionView #50

Closed SarthakGz closed 2 years ago

SarthakGz commented 2 years ago

My ViewCells have different size and also I do update size on runtime through show hide of item.So I cannot specify fixed Item size. Is there any way to set HasUnvenRow=true or SizingTechnique=MeasureAllItem For Vertical collection view I am using this library as Xamarin collection is not updating cell height on runtime for both listview and collectionview for iOS

Note : I am using vertical layout.I know I am supposed to specify item size for horizontal list but it should not necessary for vertical list right

roubachof commented 2 years ago

Can't be.. this is the whole philosophy of the Sharpnado CollectionView, don't measure it self, specify static height by data template to allow cell reuse. If you measure all, it breaks cell reuse philosophy since you have to make a layout pass for each cell displayed, and you will end up with terrible performance. You can achieve cell reuse and different heights by DataTemplate using SizedDataTemplate .

SarthakGz commented 2 years ago

Got it so size change on runtime will also not work even with SizedDataTemplate unless I call uiCollectionView.ReloadData(); by myself