gpt4 book ai didi

c# - OxyPlot.Xamarin.Forms 包中断 Resource.Designer.cs?

转载 作者:太空狗 更新时间:2023-10-29 13:58:54 26 4
gpt4 key购买 nike

我正在尝试在我的共享 Xamarin.Forms 项目中使用 OxyPlot.Xamarin.Forms 包。我在可移植和平台特定 (Android) 项目中添加了带有 NuGet 包管理器的 OxyPlot 包,如下所述:

http://docs.oxyplot.org/en/latest/getting-started/hello-xamarin-forms.html

然后我在 Android 项目中初始化了 OxyPlot 渲染器。现在,当我尝试启动应用程序时,会生成 Resource.Designer.cs 文件,但我会收到数百个这样的错误:

Error   CS0117  'Resource.Attribute' does not contain a definition for 'mediaRouteSettingsDrawable' OxyPlotShared.Droid \OxyPlotShared\OxyPlotShared.Droid\Resources\Resource.Designer.cs

我使用 Xamarin.Forms v2.2.0.31 和版本 1.0.0-unstable1983 中的所有 OxyPlot 包。

我错过了什么吗?

最佳答案

请注意,有 2 种不同的项目模板:PortableShared。在你的帖子中你提到了他们两个,所以要清楚你使用的是哪一个。您所关注的具体示例是针对可移植 项目模板的。添加 OxyPlot Nuget 包 后,我必须手动将 OxyPlotOxyPlot.Xamarin.Forms 添加到 References 可移植之一。在那之后,它工作得很好。我正在使用 Xamarin.Forms 2.0.0.6482 和 OxyPlot 1.0.0-unstable1983。

我使用代码添加了 PlotView:

应用程序:

 public App()
{
PlotModel plotModel = new PlotModel { PlotAreaBackground = OxyColors.LightYellow };
plotModel.Series.Add(new FunctionSeries(Math.Sin, -10, 10, 0.1, "sin(x)"));

// The root page of your application
MainPage = new ContentPage {
Content = new PlotView {
VerticalOptions = LayoutOptions.Fill,
HorizontalOptions = LayoutOptions.Fill,
Model = plotModel
}
};
}

enter image description here

关于c# - OxyPlot.Xamarin.Forms 包中断 Resource.Designer.cs?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37344699/

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