【问题标题】:OxyPlot.Xamarin.Forms package breaks Resource.Designer.cs?OxyPlot.Xamarin.Forms 包破坏 Resource.Designer.cs?
【发布时间】:2016-05-20 10:46:30
【问题描述】:

我正在尝试在我的共享 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 包。

我错过了什么吗?

【问题讨论】:

    标签: c# android charts xamarin.forms oxyplot


    【解决方案1】:

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

    我使用代码添加了PlotView

    App.cs:

     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
                }
            };
        }
    

    【讨论】:

    • 它适用于 Xamarin.Forms 2.0.0.x,甚至适用于 2.1.0.x,但不适用于 Xamarin 2.2.0.31。需要修复 Oxyplot.Xamarin.Android 库才能兼容 AppCompact 23.3.0
    • 是的 OxyPlot.Xamarin.Forms.1.0.0-unstable1983 (Android) 是“绝命毒师”,我的精神回到了 1883 年
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-14
    • 1970-01-01
    • 2012-03-26
    • 2016-10-09
    • 2016-06-05
    • 1970-01-01
    相关资源
    最近更新 更多