1
votes

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.

2
Is your iOS project set to allow http requests? - Rohit Vipin Mathews
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key><true/> </dict> IOS disable http resuqests by default - Artem Zelinskiy

2 Answers

2
votes

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

0
votes

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