【问题标题】:syncfusion Xamarin error同步融合 Xamarin 错误
【发布时间】:2017-09-30 10:49:32
【问题描述】:

在主活动页面上收到此错误... System.TypeLoadException:解码自定义属性时无法加载类型 Syncfusion.RangeNavigator.XForms.Droid.RangeNavigatorEventDependencyService:(null)

只是尝试实现一个 sfchart,甚至还没有通过入门并且已经遇到错误。

这是我的主要活动代码

using System;


using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Syncfusion.SfChart.XForms.Droid;

namespace Drip.Droid
{
    [Activity(Label = "Drip.Droid", Icon = "@drawable/icon", Theme = "@style/MyTheme", 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);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            new SfChartRenderer();

            LoadApplication(new App());
        }
    }
}

这是我的 xaml 代码

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Drip.MyPage" xmlns:chart="clr-namespace:Syncfusion.SfChart.XForms;assembly=Syncfusion.SfChart.XForms">
    <ContentPage.Content>
   <chart:SfChart x:Name="Chart">

    <chart:SfChart.PrimaryAxis>
  <chart:CategoryAxis LabelRotationAngle= "-45">
    <chart:CategoryAxis.Title>
      <chart:ChartAxisTitle Text="Meetup Date"/>
    </chart:CategoryAxis.Title>
  </chart:CategoryAxis>
</chart:SfChart.PrimaryAxis>

    <chart:SfChart.SecondaryAxis>
  <chart:NumericalAxis>
    <chart:NumericalAxis.Title>
      <chart:ChartAxisTitle Text="Count"/>
    </chart:NumericalAxis.Title>
  </chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
</chart:SfChart>
    </ContentPage.Content>
</ContentPage>

【问题讨论】:

    标签: c# xaml xamarin syncfusion


    【解决方案1】:

    看起来您正在使用图表控件的 xamarin 表单版本。确保在 android 项目中添加对以下 dll 的引用

    Syncfusion.SfChart.XForms.Android.dll

    Syncfusion.SfChart.XForms.dll

    https://help.syncfusion.com/xamarin/introduction/control-dependencies#sfchart

    【讨论】:

    • 我已经做到了。不确定我是否正确地完成了它。我在 mac 上的视觉工作室社区。我右键单击引用并编辑引用然后网络程序集并浏览必要的文件并点击确定
    • 您是否在项目中使用任何其他同步融合控件?
    • 我尝试使用数据网格控件,但也无法正常工作,所以我自己制作了自定义列表视图。
    • 好的,你确定你删除了所有的数据网格控件引用吗?
    • 我应该这样做吗?您不能在一个应用中使用 2 个控件?
    【解决方案2】:

    我们恳请您重建并运行您的应用程序以解决此问题。

    【讨论】:

      猜你喜欢
      • 2020-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多