Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

How to stop flicker when change Image.Source to use a new image with the same size as the old one?

$
0
0

Within my app, I have an Image that I associate a GestureRecognizer with. When tapped, I change the Source of the Image to address a different image (in effect, I am toggling between two images each time the Image is tapped). The two images (read from .png files) have the same dimensions.

So, the question is - why, on Windows, does toggling the Image.Source result in flicker, of the control to the right of the Image? It is as if toggling Image.Source has a hidden intermediate step, appearing to remove the old Image.Source, redraw without it, then set the new Image Source and redraw again. That intermediate redraw is unexpected. I assume this is a bug, but before I log it, has anybody found a workaround for this (other than using absolute layout to position the controls to the right of the image)?

Many thanks,

John H.


Viewing all articles
Browse latest Browse all 75885


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>