2016-12-30 1 views
1

Xlabs 또는 DLToolkit과 같은 다운로드 패키지를 참조하려는 경우 xamarin은 항상 오류를 발생시킵니다. 더 구체적으로 여기 Xamarin이 제어 라이브러리 참조 오류를 형성합니다

DLToolkit

에서 Heres는 코드를 FlowListView를 참조 내 PCL 프로젝트의 예입니다

위치 (32) : 여기

<?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:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms.Controls" 
      xmlns:flv="clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView" 
      x:Class="TamarianApp.ImagePage"> 
     <ContentPage.Content> 
      <Grid> 
       <StackLayout x:Name="mainView"> 
        <ScrollView> 
         <StackLayout> 
          <BoxView Margin="0, -7, 0, 0" HorizontalOptions="FillAndExpand" HeightRequest="1" BackgroundColor="#f1f1f1"></BoxView> 
          <StackLayout x:Name="cameraMenuOption" Padding="10" Orientation="Horizontal" HorizontalOptions="Fill" > 
           <Label Margin="10, 2,0,0" HorizontalOptions="StartAndExpand">Camera</Label> 
           <Label x:Name="camera_label" Margin="10, 2,10,0" FontSize="14" TextColor="#c1c1c1" HorizontalOptions="End"></Label> 
           <Image HorizontalOptions="End" Source="icons/blue/next" WidthRequest="20"></Image> 
          </StackLayout> 
          <BoxView HorizontalOptions="FillAndExpand" HeightRequest="1" BackgroundColor="#f1f1f1"></BoxView> 
          <StackLayout x:Name="libraryMenuOption" Padding="10" Orientation="Horizontal" HorizontalOptions="Fill" > 
           <Label Margin="10, 2,0,0" HorizontalOptions="StartAndExpand">Library</Label> 
           <Label x:Name="library_label" Margin="10, 2,10,0" FontSize="14" TextColor="#c1c1c1" HorizontalOptions="End"></Label> 
           <Image HorizontalOptions="End" Source="icons/blue/next" WidthRequest="20"></Image> 
          </StackLayout> 
         </StackLayout> 
        </ScrollView> 
        <StackLayout BackgroundColor="#fafafa" HorizontalOptions="FillAndExpand" > 
         <BoxView HorizontalOptions="FillAndExpand" HeightRequest="3" BackgroundColor="#f1f1f1"></BoxView> 
        </StackLayout> 
        <StackLayout> 
         <flv:FlowListView FlowColumnCount="3" x:Name="image_gallary"> 
          <FlowListView.ItemTemplate> 
           <DataTemplate> 
            <Grid> 
             <Image Source="{Binding ImageUri}"></Image> 
            </Grid> 
           </DataTemplate> 
          </FlowListView.ItemTemplate> 
         </flv:FlowListView> 
        </StackLayout> 
       </StackLayout> 
       <StackLayout x:Name="picture_view" IsVisible = "false"> 
        <Image x:Name="mainImage" VerticalOptions="Fill" HorizontalOptions="Fill"></Image> 
        <ActivityIndicator x:Name="loading_activity" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" IsRunning="false"></ActivityIndicator> 
        <StackLayout x:Name="confirm_button" HorizontalOptions="FillAndExpand" Orientation="Horizontal" Padding="15, 10, 15, 10" VerticalOptions="EndAndExpand" BackgroundColor="White"> 
         <Button Text="Confirm" Clicked="upload_clicked" HorizontalOptions="StartAndExpand" FontSize="18"></Button> 
         <Button Text="Cancel" Clicked="cancel_clicked" HorizontalOptions="End" FontSize="18"></Button> 
        </StackLayout> 
       </StackLayout> 
      </Grid> 
     </ContentPage.Content> 
    </ContentPage> 

오류이다 (9). 백엔드에 컨트롤 초기화 1. 추가 FlowListView.Init() AppDelegate.cs 2로 : FlowListView 내가 시도 http://xamarin.com/schemas/2014/forms

의 xmlns에없는 유형 image_gallary = 새로운 FlowListView();

감사합니다.

답변

0

<FlowListView.ItemTemplate> 대신 <flv:FlowListView.ItemTemplate>과 끝 태그에도 동일하게 선언하십시오. 이러한 객체가 어느 네임 스페이스에 있는지 결정해야합니다.

접두어가없는 경우 기본 네임 스페이스에 있다고 가정합니다. 그러나 그렇지 않습니다. 그러므로 FlowListView과 관련된 모든 것은 네임 스페이스 인 접두사가되어야합니다 (귀하의 경우 flv).

관련 문제