Xamarin 使用第三方控件库时,在xmlns生成错误中找不到类型
我通过nuget在我的Xamarin forms项目中添加了一个第三方控件。我向库的xaml中添加了一个xmlns,但在构建时出现错误:Xamarin 使用第三方控件库时,在xmlns生成错误中找不到类型,xamarin,xamarin.forms,Xamarin,Xamarin.forms,我通过nuget在我的Xamarin forms项目中添加了一个第三方控件。我向库的xaml中添加了一个xmlns,但在构建时出现错误:在xmlns clr命名空间中找不到flv:FlowListView:DLToolkit.Forms.Controls.Helpers.FlowListView;assembly=DLToolkit.Forms.Controls.FlowListView 使用以下xaml <?xml version="1.0" encoding="utf-8" ?>
在xmlns clr命名空间中找不到flv:FlowListView:DLToolkit.Forms.Controls.Helpers.FlowListView;assembly=DLToolkit.Forms.Controls.FlowListView
使用以下xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:flv="clr-namespace:DLToolkit.Forms.Controls.Helpers.FlowListView;assembly=DLToolkit.Forms.Controls.FlowListView"
x:Class="FScruiser.XF.Pages.Page1">
<ContentPage.Content>
<flv:FlowListView>
<flv:FlowListView.FlowColumnTemplate>
<DataTemplate>
<ViewCell>
<Label Text="text"/>
</ViewCell>
</DataTemplate>
</flv:FlowListView.FlowColumnTemplate>
</flv:FlowListView>
</ContentPage.Content>
</ContentPage>
试试这个:
clr-namespace:DLToolkit.Forms.Controls
而不是
clr-namespace:DLToolkit.Forms.Controls.Helpers.FlowListView
因此,完整的命名空间定义如下:
xmlns:flv="clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView"
编辑:您也可以在其中一个示例中看到它的实际操作。谢谢。我输入FlowListView时出错,只是选择了intellisense中出现的第一个名称空间。@bit2know不客气,我很高兴听到它现在可以工作了。