Animation / How to fade-out and fade-in images

I have a grid with several images and I would like to change some of the images every 30 seconds.
How can I fade-out and fade-in images similar to jquery .fadeOut(). If not directly possible what is the easiest way to create an smooth image transition from one image to an other?

Best Answer

Answers

  • WernerSchnedlWernerSchnedl CHMember

    Thanks a lot!

  • xceedxceed GBMember ✭✭

    @MichaelCook‌ is it possible to fade the images or in my case stack layouts at the same time? As in, I've got 2 separate StackLayouts, I want to fade them at the same time for the same duration.

  • plamplam USMember
    edited November 2014

    @MichaelCook Do you know what I may be doing wrong if both lines of code take the same amount of time to animate? Also, the animation doesn't occur on Android. Instead, it suddenly appears (after the same amount of time it takes in iOS) instead of fading in. :(

    BgImage.FadeTo(1, 1000);

    BgImage.FadeTo(1, 100000);

  • OddbjornBakkeOddbjornBakke NOMember ✭✭

    @plam said:
    @MichaelCook Do you know what I may be doing wrong if both lines of code take the same amount of time to animate? Also, the animation doesn't occur on Android. Instead, it suddenly appears (after the same amount of time it takes in iOS) instead of fading in. :(

    BgImage.FadeTo(1, 1000);

    BgImage.FadeTo(1, 100000);

    Try to await the FadeTo task. Or Xamarin.Forms.Device.BeginInvokeOnMainThread.

  • tchambiltchambil PEMember

    thanks

Sign In or Register to comment.