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

Error when using DraggableViewCell into CollectionView #87

Open AmirImam opened 1 year ago

AmirImam commented 1 year ago

H I have an error that appears when I try to display a DraggableViewCell into a CollectionView The error is: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.view.View.getLayoutParams()' on a null object reference

Sharpnado.CollectionView 2.1.0 Xamarin.Forms 5.0.0.2515

Xaml Code:

<StackLayout>
        <sho:CollectionView
            x:Name="Collector"
            EnableDragAndDrop="True"
            ItemHeight="140"
            ItemSpacing="20"
            ItemsSource="{Binding DesiresList}"
            VerticalOptions="FillAndExpand">
            <sho:CollectionView.ItemTemplate>
                <DataTemplate>
                    <sho:DraggableViewCell IsDragAndDropping="True" IsDraggable="True">
                        <ContentView>
                            <StackLayout>
                                <Label Text="{Binding Name}" />
                            </StackLayout>
                        </ContentView>
                    </sho:DraggableViewCell>

                </DataTemplate>
            </sho:CollectionView.ItemTemplate>
        </sho:CollectionView>
    </StackLayout>

Note: The library works fine when I create a new empty project, but this error appeared when I try to run it on the existing project, and There are a lot of libraries that already installed on this project.

Update: This error appearing now Cannot invalidate item decorations during a scroll or layout Nothing changed, just this error appeared instead of the previous one