Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

ListView memory leaks

$
0
0

I have a Xamarin Forms application. On the main page there is a ListView, every view cell contains text with image. When I start to scroll from beginning to end, after that from the end to the beginning and again and again, the app crashes. Any scrolling increases the allocated memory and after several steps the app crashes.

<ListView
                ItemsSource="{Binding ViewData}"
                ItemAppearing="OnItemAppearing"
                HasUnevenRows="True"
                SeparatorVisibility="None"
                x:Name="NewsAndFeedListView">
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <ViewCell.View>
                            <Grid>
                                <ffimageloading:CachedImage  Grid.Row="0" DownsampleToViewSize="True" Aspect="AspectFill"       x:Name="MainPhoto">
                                    <ffimageloading:CachedImage.GestureRecognizers>
                                        <TapGestureRecognizer Tapped="MainPhotoTapped" NumberOfTapsRequired="1"/>
                                    </ffimageloading:CachedImage.GestureRecognizers>
                                </ffimageloading:CachedImage>
                                <Label Text="Click here"></Label>
                            </Grid>
                    </ViewCell.View>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

The image's source is set in the code behind in the Viewcell's BindingContextChenged method. Is there some resolution for this problem?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>