Allow third party libs to display animated images correctly in view recycling scenari...
authorDaniel Luberda <daniel.luberda@gmail.com>
Thu, 23 May 2019 00:31:01 +0000 (02:31 +0200)
committerRui Marinho <me@ruimarinho.net>
Thu, 23 May 2019 00:31:01 +0000 (01:31 +0100)
* VisualElementRenderer and ElevationHelper should be public

* ElevationHelper.SetElevation should be public

* remove comment

* Allows to display animated images on iOS in recycled views (CollectionView, ListView)

Xamarin.Forms.Platform.iOS/Renderers/ImageElementManager.cs

index d17d23e..ee0323a 100644 (file)
@@ -105,7 +105,11 @@ namespace Xamarin.Forms.Platform.iOS
 
                        var source = imageElement.Source;
 
-                       if (oldElement != null)
+                       if (Control.Image?.Images != null && Control.Image.Images.Length > 1)
+                       {
+                               renderer.SetImage(null);
+                       }
+                       else if (oldElement != null)
                        {
                                var oldSource = oldElement.Source;
                                if (Equals(oldSource, source))