I am trying to use the FFImageLoading in a cross-platform xamarin app.
I followed the instructions, and installed the Xamarin.FFImageLoading and Xamarin.FFImageLoading.Forms in both the android and IOS projects.
I then use this code to intitialize the library:
[Activity (Label = "app", Icon = "@drawable/icon", Theme="@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate (Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate (bundle);
CachedImageRenderer.Init();
global::Xamarin.Forms.Forms.Init (this, bundle);
global::Xamarin.Auth.Presenters.XamarinAndroid.AuthenticationConfiguration.Init(this, bundle);
LoadApplication (new TheWillowEffect.App ());
}
}
I haven't tried in it IOS yet. Not a priority.
I have the following XAML just to see if it works:
<ContentPage
....xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"....>
....
<ffimageloading:CachedImage HorizontalOptions="Center" VerticalOptions="Center"
WidthRequest="300" HeightRequest="300"
DownsampleToViewSize="true"
Source = "http://loremflickr.com/600/600/nature?filename=simple.jpg"
Grid.Column="1"
Grid.Row="1">
When I run it, I get:
System.MissingMethodException: method 'FFImageLoading.Forms.Droid.CachedImageRenderer.init()' not found.
Not sure what's going on. I suspect intellisense would have caught a missing using
, and there are no errors during compile, only the one above, at runtime.
What have I done wrong!?
Just had to clean the project and rebuild.