1

I'm using Xamarin.SDWebImage 4.4.7 from Microsoft and would like to fade in an image. I know that the original library has built-in image transitions:

imageView.sd_imageTransition = .fade
let url = URL(string: "https://foo/bar.jpg")
imageView.sd_setImage(with: url)

How can this be done in Xamarin?

user246392
  • 2,661
  • 11
  • 54
  • 96
  • What does your xamarin.ios code look like currently? – ToolmakerSteve May 14 '22 at 02:15
  • Nothing special. I'm using the `SetImage` extension method from SDWebImage and passing an `NSUrl`. Here's an example: `uiImageView.SetImage(new NSUrl(source))` – user246392 May 14 '22 at 02:31
  • 1
    Unfortunately, looking at github source for that nuget, [SDWebImage/ApiDefinition.cs](https://github.com/xamarin/XamarinComponents/blob/main/iOS/SDWebImage/source/SDWebImage/ApiDefinition.cs) only mentions image download & caching APIs of SDWebImage. Looking at original lib demo's [MasterViewController](https://github.com/SDWebImage/SDWebImage/blob/master/Examples/SDWebImage%20Demo/MasterViewController.m), library uses a customImageView to do transitions. AFAIK, No easy way to add to xamarin version. Use [iOS CoreAnimation](https://stackoverflow.com/a/31077671/199364) for transitions. – ToolmakerSteve May 14 '22 at 03:12

0 Answers0