I'm using Xamarin Forms and Xamarin Android.
I've this code for reading some files (stored inside an Android Phone)
public ImageSource Photo { get; set; }
public void LoadPhoto()
{
var t = Android.Net.Uri.Parse("URI_OF_THE_PHOTO");
var otherStream = Android.App.Application.Context.ContentResolver.OpenInputStream(t);
Photo = Xamarin.Forms.ImageSource.FromStream(() => otherStream);
}
then, in my XAML Page, inside a ListView's ViewCell i have this Image control:
<Image Source="{Binding Photo}"></Image>
Eveything works perfectly, the images (about 50) are loaded correctly and displayed inside the ListView.
BUT when i scroll the ListView and the images go out of the screen, when i scroll them back, they're EMPTY ! Images are suddendly gone... DISAPPEARED !!!
I've found a couple of StackOverflow's cases similar to this, but i can't get it to work with those solutions, they seem to not apply to my case.
Please, help, i'm stuck with this problem !
CachingStrategy
for theListView
– Gerald VersluisCachingEnabled
property of the image totrue
? – Oluwasayo Babalola