gpt4 book ai didi

c# - 请在特定于平台的项目中调用 CachedImageRenderer.Init 方法以使用 FFImageLoading?

转载 作者:太空宇宙 更新时间:2023-11-03 19:41:29 25 4
gpt4 key购买 nike

尝试在 iO 上使用 Xamarin FFImageLoading 插件时出现此异常:

System.Exception: Please call CachedImageRenderer.Init method in a platform specific project to use FFImageLoading!
at FFImageLoading.Forms.CachedImage.OnSourcePropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00007] in C:\projects\ffimageloading\source\FFImageLoading.Forms\CachedImage.cs:133
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:625
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xam
arin.Forms.Core\BindableObject.cs:417
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:573
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99
at FFImageLoading.Forms.CachedImage.set_Source (Xamarin.Forms.ImageSource value) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Forms\CachedImage.cs:173
at Demo.MainViewModel..ctor () [0x0001f] in <4cd5393447f94973bb9eef7c0de8880d>:0
at FullCameraApp.CameraPage.getLayoutImage (System.Int32 index) [0x00001] in <4cd5393447f94973bb9eef7c0de8880d>:0
at FullCameraApp.CameraPage..ctor (ScoreScan.webServices.WebServices webServices, System.Collections.Generic.List`1[T] imageBytesList) [0x0060b] in <4cd5393447f94973bb9eef7c0de8880d>:0
at ScoreScan.App..ctor () [0x0
0025] in <4cd5393447f94973bb9eef7c0de8880d>:0
at ScoreScan.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x0000d] in <4cd5393447f94973bb9eef7c0de8880d>:0
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/UIKit/UIApplication.cs:63
at ScoreScan.iOS.Application.Main (System.String[] args) [0x00001] in <4cd5393447f94973bb9eef7c0de8880d>:0
2018-10-08 19:47:10.229 ScoreScan.iOS[324:13181] Unhandled managed exception:
Please call CachedImageRenderer.Init method in a platform specific project to use FFImageLoading! (System.Exception)
at FFImageLoading.Forms.CachedImage.OnSourcePropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00007] in C:\projects\ffimageloading\source\FFImageLoading.Forms\CachedImage.cs:133
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:625
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a
\1\s\Xamarin.Forms.Core\BindableObject.cs:417
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:573
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99
at FFImageLoading.Forms.CachedImage.set_Source (Xamarin.Forms.ImageSource value) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Forms\CachedImage.cs:173
at Demo.MainViewModel..ctor () [0x0001f] in <4cd5393447f94973bb9eef7c0de8880d>:0
at FullCameraApp.CameraPage.getLayoutImage (System.Int32 index) [0x00001] in <4cd5393447f94973bb9eef7c0de8880d>:0
at FullCameraApp.CameraPage..ctor (ScoreScan.webServices.WebServices webServices, System.Collections.Generic.List`1[T] imageBytesList) [0x0060b] in <4cd5393447f94973bb9eef7c0de8880d>:0
at ScoreScan.App..ctor
ktrace:

如何解决这个异常?

最佳答案

在 global::Xamarin.Forms.Forms.Init() 之后调用 CachedImageRenderer.Init;在 iOS 项目的 AppDelegate.cs 文件中的 FinishedLaunching 方法中。

它清楚地提到您需要在其中调用 Init 方法。详情将在FFImageLoading插件的github仓库中给出

下面提到了link

关于c# - 请在特定于平台的项目中调用 CachedImageRenderer.Init 方法以使用 FFImageLoading?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52711881/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com