Ffimageloading: Delay in loading image for first time

Created on 3 Nov 2017  路  2Comments  路  Source: luberda-molinet/FFImageLoading

I'm having an issue where the first time I try loading an image, there is a slight delay before it is visible. I don't see this delay after the first. I also don't experience this delay when using an Image vs a CachedImage.

I assume this is due to caching because it will fade in when the fade animation is set to perform.

What I am trying to do:

  1. Fade to 0 opacity and move the image
  2. Change the image source while image is transparent
  3. Relocate image back to default spot
  4. Fade back in

What I am getting

  1. Fade and move correctly
  2. Relocate image correctly
  3. Fade in
  4. Image changes

Things to note:

  • I am using the VisualElement.FadeTo method to fade my images out and in
  • My images are locally stored in the file system rather than as an android resource

If I extend the length of the fade, the CachedImage will change while the fade happens.

I noticed someone else had a similar problem like in issue #564, but the suggested addition of a permission didn't help me.

Am I missing a setting or a way to preload items into cache?

Xamarin.Forms question

Most helpful comment

Hi @tiscott1

  • Set LoadingDelay property to 0 - it's 15ms by default
  • You can just disable fade animation for your view (FadeAnimationEnabled property).
  • You can preload image to a memory cache earlier ImageService.Instance.Load[Url/File].Preload()
  • For handling animations you should use CachedImage.Success/Finish/Error callbacks as image loading is queued sometimes (if many tasks pending).

All 2 comments

Hi @tiscott1

  • Set LoadingDelay property to 0 - it's 15ms by default
  • You can just disable fade animation for your view (FadeAnimationEnabled property).
  • You can preload image to a memory cache earlier ImageService.Instance.Load[Url/File].Preload()
  • For handling animations you should use CachedImage.Success/Finish/Error callbacks as image loading is queued sometimes (if many tasks pending).

Hey Daniel,

Tapping into the callbacks is exactly what I needed. Thank you for the help.

Was this page helpful?
0 / 5 - 0 ratings