ParuFrade
ParuFrade

Reputation: 21

Xamarin Forms FFImageLoading Image not showing

I am trying to use FFImageLoading in one of our Xamarin Forms Projects but I am having some weird issues.

When I try to put Sources="anyvalidimageurl" on the XAML, I get this error:

Invalid XAML: Value cannot be null. Parameter name: 'obj'

This is the XAML:

<ffimageloading:CachedImage HorizontalOptions="Center" 
            WidthRequest="300" 
            HeightRequest="300"
            DownsampleToViewSize="true"
            Source="http://myimage.com/image.png"
            x:Name="imgImage">
</ffimageloading:CachedImage>

I tried to load the image through code, but no image is shown on iOS.

Upvotes: 1

Views: 2513

Answers (2)

Sangadji
Sangadji

Reputation: 321

You need to add this to your AppDelegate.cs

  public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        FFImageLoading.Forms.Touch.CachedImageRenderer.Init();
        var dummy = new FFImageLoading.Forms.Touch.CachedImageRenderer();

        global::Xamarin.Forms.Forms.Init();
        LoadApplication(new App());

        return base.FinishedLaunching(app, options);
    }

For more information see https://github.com/luberda-molinet/FFImageLoading/issues/55

Upvotes: 2

user2964251
user2964251

Reputation: 51

Did you miss to include CachedImageRenderer.Init(); in AppDelegate.cs

Upvotes: 0

Related Questions