[Android] CachedImage doesn't load in SFListView until after scrolled off screen
See original GitHub issueI’m finding some strange behavior whereby when I load a CachedImage into an ItemTemplate within an SFListView, I see a blank space where the image should be until I scroll.
Here’s a template
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xaml="clr-namespace:MyApp.SelfServe.Mobile.Xaml;assembly=MyApp.SelfServe.Mobile"
xmlns:forms="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:controls="clr-namespace:MyApp.SelfServe.Mobile.Controls;assembly=MyApp.SelfServe.Mobile"
x:Class="MyApp.SelfServe.Mobile.Pages.UserAccount.Projects.Templates.ProjectListTemplate">
<Grid HorizontalOptions="Fill" VerticalOptions="Fill" Margin="0" Padding="0"
BackgroundColor="{Binding IsSelected, Converter={StaticResource SfListViewSelectionConverter}}"
RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition>
<RowDefinition.Height>
<OnPlatform x:TypeArguments="GridLength">
<On Platform="Android" Value="120" />
<On Platform="iOS" Value="100" />
</OnPlatform>
</RowDefinition.Height>
</RowDefinition>
<RowDefinition Height="1" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="40" />
</Grid.ColumnDefinitions>
<BoxView Grid.Column="0"
Grid.Row="0"
Color="{Binding Phase, Converter={StaticResource ProjectPhaseToColorConverter}, ConverterParameter={Binding HasAlert}}"
WidthRequest="5"
HeightRequest="999"
VerticalOptions="FillAndExpand" />
<forms:CachedImage Grid.Column="1"
Grid.Row="0"
HorizontalOptions="Center"
VerticalOptions="Center"
Source="{Binding PhaseIcon}" />
<StackLayout Grid.Column="2"
Grid.Row="0"
Spacing="2"
VerticalOptions="Center">
<Label Text="{Binding Nickname}" Style="{StaticResource Common-Title}"
LineBreakMode="TailTruncation" />
<Label FormattedText="{Binding RequestNumberFormatted}"
LineBreakMode="TailTruncation" />
<Label FormattedText="{Binding PhaseFormatted}"
LineBreakMode="TailTruncation" />
<Label FormattedText="{Binding SiteIdFormatted}"
LineBreakMode="TailTruncation" />
<Label FormattedText="{Binding LocationFormatted}"
LineBreakMode="TailTruncation" />
</StackLayout>
<controls:TintedCachedImage
Grid.Column="3"
Grid.Row="0"
Source="arrow.png"
HorizontalOptions="Center"
VerticalOptions="Center"
TintColor="{Binding Phase, Converter={StaticResource ProjectPhaseToColorConverter}, ConverterParameter={Binding HasAlert}}"
InputTransparent="True"
IsVisible="{Binding IsBusy, Converter={StaticResource InverseBoolConverter}}" />
<ActivityIndicator Grid.Column="3"
Grid.Row="0"
IsVisible="{Binding IsBusy}"
IsRunning="{Binding IsBusy}" />
<BoxView Grid.Column="0"
Grid.Row="1"
Grid.ColumnSpan="4"
HeightRequest="1"
HorizontalOptions="FillAndExpand"
Color="{xaml:ResxColor PrimaryDarkBlue}" />
</Grid>
</ContentView>
Page Load
Partial Scroll Down
After Scroll down and back to top
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
android - Listview not loading images till I scroll the screen
1 Answer 1 ... As Listview use the concept of recycling its view. The images are not showing when the async call finish....
Read more >Working with ListView in Xamarin ListView (SfListView)
When the SfListView is loaded inside the ScrollView with the height of total items, scrolling will not occur in the SfListView only when...
Read more >Scrolling in Xamarin ListView (SfListView)
If the item is already in view, scrolling will not occur. Start: Scrolls a specific item to be positioned at the begin of...
Read more >Valley immediate care grants pass oregon
I have problem with scroll many downloaded images (displaying by url) in listview. I'm a beginner of Xamarin Forms. Or you can use...
Read more >Xamarin Scrollview only showing partial data up to screen ...
Hello, I have a frame with a stacklayout inside of a scrollview, when I open the page, labels and data show up, but...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@daniel-luberda, that last update works, thanks
Yes, I want to fix issue 808 and release next stable today.