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

I have some blinking when i replace image

$
0
0

I am working with xamarin forms and trying to create navigation menu. I need to set new image when i click on cell. I have some blinking when i replace image.

I create image:
var image = new Image { Source = "Image.png"; }

I add it on my grid

        var profileTapRecognizer = new TapGestureRecognizer();
                    profileTapRecognizer.Tapped += (sender, e) =>
                    {
                        ItemClicked(sender as ITaggedCell);
                    };

            image.GestureRecognizers.Add(profileTapRecognizer);

        grid.Children.Add(image, i, 0);

And in ItemClicked i change source and have blink before new image was set:

   image.Source = "NewImage.png" 

What is the best way to change image?
I tried image.BatchBegin() BatchCommit() and this way http://stackoverflow.com/questions/31790198/how-to-change-image-source-while-clicking-on-the-listview-in-xamarin-forms


Viewing all articles
Browse latest Browse all 75885

Trending Articles



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