我正在尝试在跨平台的xamarin应用程序中使用FFImageLoading。
我按照说明,在安卓和IOS项目中安装了Xamarin.FFImageLoading和Xamarin.FFImageLoading.Forms。
然后,我使用这段代码对库进行了简化:
[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 ());
}
}我还没试过呢。不是优先考虑。
为了查看它是否有效,我有以下XAML:
<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">当我运行它时,我得到:
System.MissingMethodException: method 'FFImageLoading.Forms.Droid.CachedImageRenderer.init()' not found.不知道怎么回事。我怀疑intellisense会捕捉到缺少的using,并且在编译过程中没有错误,只有上面的一个错误,在运行时。
我做错什么了!?
发布于 2017-11-14 17:54:44
只需要清理工程和重建。
https://stackoverflow.com/questions/47126495
复制相似问题