如何在CollectionView中顺利加载大量图像?

问题描述

我有大约600张图像要显示在CollectionView(来自URL)中。 我创建了以下CollectionView:

<CollectionView ItemsSource="{Binding Models}">
 <CollectionView.ItemTemplate>
  <DataTemplate>
   <ff:CachedImage Source="{Binding image}"/>
  </DataTemplate>
 </CollectionView.ItemTemplate>
</CollectionView>

现在,有很多滞后。我该如何避免?

解决方法

解决了。

将CollectionView替换为ListView,并将其CachingStrategy设置为“ RecycleElementAndDataTemplate”。