我正在使用Xamarin Forms创建一个应用程序,我将使用OxyPlot显示图形,在Android和Windows Phone上运行Hello World OxyPlot,但我遇到了IOS问题。当模拟器加载应用程序时,发送以下内容:
{System.IO.FileNotFoundException:无法加载文件或程序集'OxyPlot.Xamarin.iOS'}
和堆栈:
/ users / builder / data / lanes / 1962中的System.AppDomain.Load(assemblyRef = {OxyPlot.Xamarin.iOS,Version = 2015.1.889.0,Culture = neutral,PublicKeyToken = null},assemblySecurity =(null)) /8b265d64/source/mono/mcs/class/corlib/System/AppDomain.cs:706
似乎没有提到Packete Oxyplot.xamarin.iOS,但没有提到如何解决它。
我在每个平台上添加了Nuget预发布的OxyPlot Xamarin Forms。正如我在android和windows phone(使用visual studio)中提到的那样正常工作。
感谢您的关注,如果需要更多数据,请继续关注。
问候
答案 0 :(得分:0)
确保已安装https://www.nuget.org/packages/OxyPlot.Xamarin.Forms/。然后,您需要在Xamarin.Forms.Forms.Init()
之前添加以下调用来初始化OxyPlot渲染器:
iOS:OxyPlot.Xamarin.Forms.Platform.iOS.Forms.Init();
Android:OxyPlot.Xamarin.Forms.Platform.Android.Forms.Init();
WinPhone:OxyPlot.Xamarin.Forms.Platform.WinPhone.Forms.Init();
OR
由于Xamarin接头,组装可能会被切断。添加:
iOS项目var ignoreOxyplot = typeof(OxyPlot.Xamarin.Forms.Platform.iOS.PlotViewRenderer)
方法中的 FinishedLaunching
。