About a little over a year ago, there was a property introduced on the Xamarin Forms ListView called CachingStrategy, which can be set to RecycleElement. Is this built in to the RADListView? I have numerous items (60+) on 4 lists with embedded images (160x160) thumbnails in my app. When I test this on the device with decent memory, I am getting very poor performance (painting slow or not at all with the images). Here is a link to information about this property setting. I tried to set it on the RADListView but got no property found. I am using the grid layout format for the ListView.
Some performance tips are here, including use of CachingStrategy...
https://blog.xamarin.com/optimizing-xamarin-forms-apps-for-maximum-performance/
I am also using:
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]I trimmed down the images as best I could.
Image List 1 total size, 61 files 900KB, bit depth 8 - 160x160
Image List 2 total size, 37 files 804KB, bit depth 8 160x160
Image List 3 total size, 22 files 344KB (this is the only one that is snappy, I am guessing because it has the fewest elements), bit depth 24, 160x160
Image List 4 total size, 62 files 704KB, bit depth 8, 160x160
I also have Java Heap space set to the max 1G in the Android settings, and testing with release mode.
Also, I have to set the HeightRequest on the RADListView to something really high, like 1500 to get these images to appear on the list on first appearing.
Here is my XAML:
<telerikDataControls:RadListView HeightRequest="1500" x:Name="RADlistView"<br> BackgroundColor="White" <br> SelectedItem="{Binding objSelectedTumor, Mode=TwoWay}" ><br> <telerikDataControls:RadListView.ItemTemplate><br> <DataTemplate><br> <telerikListView:ListViewTemplateCell><br> <telerikListView:ListViewTemplateCell.View><br> <Grid Padding="10" RowSpacing="5" HorizontalOptions="Center" VerticalOptions="Center"><br> <Grid.RowDefinitions><br> <RowDefinition Height="6*" /><br> <RowDefinition Height="*" /><br> </Grid.RowDefinitions><br> <Grid.ColumnDefinitions><br> <ColumnDefinition Width="*" /><br><br> </Grid.ColumnDefinitions><br> <!--these options cause System.NullReferenceException: Object reference not set to an instance of an object in iOS. <br> HorizontalOptions="Center"<br> VerticalOptions="Center"--><br> <controls:CircleImage Grid.Row="0"<br> Source="{Binding thumb_file_image_name} Converter={StaticResource ImageConverter}"<br> Aspect="AspectFit"<br> IsVisible="{StaticResource showSectionAndroidWin}"<br> <br> ><br> <controls:CircleImage.WidthRequest><br> <OnPlatform x:TypeArguments="x:Double"<br> iOS="55"<br> Android="55"<br> WinPhone="75"<br> /><br> </controls:CircleImage.WidthRequest><br> <controls:CircleImage.HeightRequest><br> <OnPlatform x:TypeArguments="x:Double"<br> iOS="55"<br> Android="55"<br> WinPhone="75"<br> /><br> </controls:CircleImage.HeightRequest><br> </controls:CircleImage><br> <Image Grid.Row="0"<br> Source="{Binding thumb_file_image_name} Converter={StaticResource ImageConverter}"<br> Aspect="AspectFit"<br> IsVisible="{StaticResource showSectioniOS}"<br> ><br> <Image.WidthRequest><br> <OnPlatform x:TypeArguments="x:Double"<br> iOS="55"<br> Android="55"<br> WinPhone="75"<br> /><br> </Image.WidthRequest><br> <Image.HeightRequest><br> <OnPlatform x:TypeArguments="x:Double"<br> iOS="55"<br> Android="55"<br> WinPhone="75"<br> /><br> </Image.HeightRequest><br> </Image><br><br> <Grid Grid.Row="1"<br> Grid.Column="0"<br> RowSpacing="1"<br> VerticalOptions="Start"<br> HorizontalOptions="Center"<br> ><br> <Grid.RowDefinitions><br> <RowDefinition Height="*" /><br> </Grid.RowDefinitions><br> <Grid.ColumnDefinitions><br> <ColumnDefinition Width="*" /><br> </Grid.ColumnDefinitions><br> <Label Grid.Row="0"<br> Grid.Column="0"<br> LineBreakMode="NoWrap"<br> BackgroundColor="Transparent"<br> HorizontalTextAlignment="Center"<br> VerticalTextAlignment="Center"<br> Text="{Binding name}"<br> TextColor="#81AABC"><br> <Label.FontSize><br> <OnPlatform x:TypeArguments="x:Double"><br> <OnPlatform.WinPhone><br> <OnIdiom x:TypeArguments="x:Double"><br> <OnIdiom.Phone>14</OnIdiom.Phone><br> </OnIdiom><br> </OnPlatform.WinPhone><br> <OnPlatform.Android><br> <OnIdiom Phone="10"<br> Tablet="12"<br> x:TypeArguments="x:Double" /><br> </OnPlatform.Android><br> <OnPlatform.iOS><br> <OnIdiom Phone="10"<br> Tablet="12"<br> x:TypeArguments="x:Double" /><br> </OnPlatform.iOS><br> </OnPlatform><br> </Label.FontSize><br> </Label><br> </Grid><br> </Grid><br> </telerikListView:ListViewTemplateCell.View><br> </telerikListView:ListViewTemplateCell><br> </DataTemplate><br> </telerikDataControls:RadListView.ItemTemplate><br> <telerikDataControls:RadListView.LayoutDefinition><br> <telerikListView:ListViewGridLayout x:Name="gridLayout" <br> VerticalItemSpacing="5" <br> HorizontalItemSpacing="5" <br> SpanCount="5" <br> ItemLength="180" /><br> </telerikDataControls:RadListView.LayoutDefinition><br> </telerikDataControls:RadListView>Any other ideas here?