2017-09-19 17 views
0

我通過nuget在Xamarin表單項目中添加了第三方控件。我添加了一個xmlns設置爲我的XAML庫,但是當我建立我的錯誤:Type flv:FlowListView not found in xmlns clr-namespace:DLToolkit.Forms.Controls.Helpers.FlowListView;assembly=DLToolkit.Forms.Controls.FlowListView在使用第三方控件庫時找不到xmlns類型的構建錯誤

使用下面的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> 

回答

0

試試這個:

clr-namespace:DLToolkit.Forms.Controls 

代替

clr-namespace:DLToolkit.Forms.Controls.Helpers.FlowListView 

因此,完整的命名空間定義是這樣的:

xmlns:flv="clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView" 

編輯:你也可以看到它在行動here on GitHub,在樣本之一。

+0

謝謝。我在輸入FlowListView時犯了錯誤,只是選擇了intellisense中出現的第一個命名空間。 – bit2know

+0

@ bit2know不客氣,我很高興聽到它現在起作用。 – hankide

相關問題