Xamarin iOS Application suspended in Monitor when UICollectionViewFlowLayout.PrepareLayout()

Published

Xamarin iOS application infinitely suspended when CollectionView.IsVisible = false on start up.

on Android, It works. However, on iOS, setting CollectionView.IsVisible = false resulted in application freezed.

    <StackLayout
        Margin="0,20,0,0">

        <Button
            HorizontalOptions="CenterAndExpand"
            WidthRequest="100"
            Clicked="Button_Clicked"
            Text="Click Me"/>

        <CollectionView
            x:Name="Collection"
            VerticalOptions="FillAndExpand"
            ItemsSource="{Binding Items}"
            SelectionMode="Single"
            IsVisible="False">

            <CollectionView.ItemsLayout>
                <GridItemsLayout
                    Orientation="Vertical"
                    Span="4"/>
            </CollectionView.ItemsLayout>
                                    
            <CollectionView.ItemTemplate>
                <DataTemplate>
                    <StackLayout
                        Margin="10,10,10,10">
                        <Image
                            WidthRequest="50"
                            HeightRequest="50"
                            Source="{local:ImageResource CollectionView.Image.png}"/>
                        <Label
                            Text="{Binding Title}"
                            HorizontalTextAlignment="Center"
                            VerticalTextAlignment="Center" />
                    </StackLayout>
                </DataTemplate>
            </CollectionView.ItemTemplate>
        </CollectionView>
    </StackLayout>

Here is reproducible project.

Source: Xamarin.ios Questions

Published
Categorised as Uncategorised Tagged , ,

Answers

Leave a Reply

Your email address will not be published. Required fields are marked *

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq