How to Load cache Image in offline in xamarin forms?

AmoseKumarAmoseKumar USMember ✭✭

The issue occurs in all 3 platforms:

I am downloading an image and stored in the cache(default option for an image source "CachingEnabled = true"), and I have set the time span to 1 day.

On Loading, the page in offline the image is not displayed. whereas if I open the page in online it seems the image is downloaded and shown

Initially, I am downloading and saving as follows

webImage.Source = new UriImageSource
{
Uri = new Uri("Some Http image"),
CachingEnabled = true,
CacheValidity=new TimeSpan(1,0,0,0)
};

In the new page, I am using the following to show the image

newImage.Source = new UriImageSource
{
Uri = new Uri("Some Http image"),
}

In Offline, An empty page has displayed the image is not loaded. I have a question is whether the image is cached or not.

My question here is ** Has the image is cached? If so how to load the cached image in offline.**

Answers

Sign In or Register to comment.