2017-05-04 12 views
0

私はXamarin PCL Android/iOS/UWPプロジェクトを持っています。私はIconize FontAwsomeアイコンを使用してアプリケーションの。問題は、UWPは、任意のアイコンを表示dosentということですが、Androidのは、このようXamarinフォームUWP、Iconizeと画像の使用方法

を行います。

enter image description here マイ形式:

<?xml version="1.0" encoding="utf-8" ?> 
<controls:BasePage xmlns="http://xamarin.com/schemas/2014/forms" 
        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
        xmlns:controls="clr-namespace:Volaapp.Controls;assembly:Volaapp" 
        xmlns:converters="clr-namespace:Volaapp.Converters;assembly:Volaapp" 
        xmlns:icons="clr-namespace:FormsPlugin.Iconize;assembly=FormsPlugin.Iconize" 
        xmlns:xlabs="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms" 
        x:Class="Volaapp.Pages.CreateTodoPage" 
        BackgroundColor="{StaticResource GrayColor}" 
        Title="Lisa uus võlg"> 
    <ScrollView BackgroundColor="{StaticResource WhiteColor}"> 
    <StackLayout Margin="10" 
       BackgroundColor="{StaticResource WhiteColor}"> 
     <Grid> 
     <Grid.ColumnDefinitions> 
      <ColumnDefinition Width="65"/> 
      <ColumnDefinition/> 
     </Grid.ColumnDefinitions> 
     <Grid.RowDefinitions> 
      <RowDefinition/> 
      <RowDefinition Height="65"/> 
      <RowDefinition Height="65"/> 
      <RowDefinition Height="65"/> 
      <RowDefinition Height="65"/> 
      <RowDefinition/> 
     </Grid.RowDefinitions> 

     <!--Nimi ja Summa--> 
     <StackLayout Grid.Column="0" Grid.Row="0" 
        BackgroundColor="{StaticResource MetroWhiteColor}" 
        VerticalOptions="FillAndExpand" 
        HorizontalOptions="FillAndExpand"> 
      <icons:IconImage VerticalOptions="CenterAndExpand" 
       HorizontalOptions="Center" 
       Icon="fa-gg" 
       IconColor="{StaticResource MetroBlackColor}" 
       HeightRequest="30"/> 
     </StackLayout> 
     <StackLayout Grid.Column="1" Grid.Row="0" 
        Orientation="Vertical" 
        BackgroundColor="{StaticResource MetroWhiteColor}" 
        HorizontalOptions="FillAndExpand" 
        VerticalOptions="FillAndExpand"> 
      <StackLayout Orientation="Vertical" 
         BackgroundColor="{StaticResource WhiteColor}" 
         HorizontalOptions="FillAndExpand" 
         VerticalOptions="FillAndExpand" 
         Margin="0,1,1,1"> 
      <Entry Text="{Binding Title}" 
        Placeholder="Sisesta pealkiri" 
        VerticalOptions="EndAndExpand" 
        Keyboard="Text" 
        Margin="15,0,15,2"/> 
      <Entry 
        VerticalOptions="EndAndExpand" 
        Placeholder="Sisesta Summa!" 
        Text="{Binding Loan}" 
        Keyboard="Numeric" 
        Margin="15,2,15,10" 
      /> 
      </StackLayout> 
     </StackLayout> 

     <!--Inimesed--> 
     <StackLayout Grid.Column="0" Grid.Row="1" 
        BackgroundColor="{StaticResource MetroWhiteColor}" 
        VerticalOptions="FillAndExpand" 
        HorizontalOptions="FillAndExpand"> 
      <icons:IconImage VerticalOptions="CenterAndExpand" 
       HorizontalOptions="Center" 
       Icon="fa-user" 
       IconColor="{StaticResource MetroBlackColor}" 
       HeightRequest="30"/> 
     </StackLayout> 
     <StackLayout Grid.Column="1" Grid.Row="1" 
        Orientation="Vertical" 
        BackgroundColor="{StaticResource MetroWhiteColor}" 
        HorizontalOptions="FillAndExpand" 
        VerticalOptions="FillAndExpand"> 
      <StackLayout Orientation="Vertical" 
         BackgroundColor="{StaticResource WhiteColor}" 
         HorizontalOptions="FillAndExpand" 
         VerticalOptions="FillAndExpand" 
         Margin="0,1,1,1"> 
      <controls:BindablePicker Margin="20,5" 
            ItemsSource="{Binding Tags}" 
            SelectedItem="{Binding SelectedTag, Mode=TwoWay}" 
            DisplayMemberPath="Title" 
            Title="Vali inimene" 
            VerticalOptions="EndAndExpand"/> 
      </StackLayout> 
     </StackLayout> 

     <!--Rahatäht--> 
     <StackLayout Grid.Column="0" Grid.Row="2" 
        BackgroundColor="{StaticResource MetroWhiteColor}" 
        VerticalOptions="FillAndExpand" 
        HorizontalOptions="FillAndExpand"> 
      <icons:IconImage VerticalOptions="CenterAndExpand" 
       HorizontalOptions="Center" 
       Icon="fa-money" 
       IconColor="{StaticResource MetroBlackColor}" 
       HeightRequest="30"/> 
     </StackLayout> 
     <StackLayout Grid.Column="1" Grid.Row="2" 
        Orientation="Vertical" 
        BackgroundColor="{StaticResource MetroWhiteColor}" 
        HorizontalOptions="FillAndExpand" 
        VerticalOptions="FillAndExpand"> 
      <StackLayout Orientation="Vertical" 
         BackgroundColor="{StaticResource WhiteColor}" 
         HorizontalOptions="FillAndExpand" 
         VerticalOptions="FillAndExpand" 
         Margin="0,1,1,1"> 
      <controls:BindablePicker Margin="20,5" 
            ItemsSource="{Binding CurrencyList}" 
            SelectedItem="{Binding Currency, Mode=TwoWay}" 
            Title="Vali Rahatäht" 
            VerticalOptions="EndAndExpand"/> 
      </StackLayout> 
     </StackLayout> 

     <!--Due date--> 
     <StackLayout Grid.Column="0" Grid.Row="3" 
        Orientation="Vertical" 
        BackgroundColor="{StaticResource MetroWhiteColor}" 
        VerticalOptions="FillAndExpand" 
        HorizontalOptions="FillAndExpand"> 

      <xlabs:ImageButton Image="_duedate.png" 
        ImageHeightRequest="35" 
        ImageWidthRequest="35" 
        BackgroundColor="{StaticResource MetroWhiteColor}" 
        VerticalOptions="CenterAndExpand" 
        HorizontalOptions="Center" 
        BorderRadius="0" 
        Command="{Binding SelectDueDateCommand}"/> 
     </StackLayout> 
     <StackLayout Grid.Column="1" Grid.Row="3" 
        BackgroundColor="{StaticResource MetroWhiteColor}" 
        HorizontalOptions="FillAndExpand" 
        VerticalOptions="FillAndExpand"> 
      <StackLayout BackgroundColor="{StaticResource WhiteColor}" 
         HorizontalOptions="FillAndExpand" 
         VerticalOptions="FillAndExpand" 
         Margin="0,1,1,1"> 
      <Label Text="{Binding DueTime, StringFormat='Kuupäev {0:dd.MM.yyyy HH:mm}'}" 
        FontSize="17" 
        Margin="25,0" 
        TextColor="{StaticResource BlackColor}" 
        VerticalTextAlignment="Start" 
        VerticalOptions="CenterAndExpand" 
        HorizontalOptions="StartAndExpand"> 
      </Label> 
      </StackLayout> 
     </StackLayout> 

     <!--Meeldetuletus--> 
     <StackLayout Grid.Column="0" Grid.Row="4" 
        Orientation="Vertical" 
        BackgroundColor="{StaticResource MetroWhiteColor}" 
        VerticalOptions="FillAndExpand" 
        HorizontalOptions="FillAndExpand"> 
      <Image HeightRequest="35" 
       WidthRequest="35" 
       Source="{Binding ReminderIcon}" 
       VerticalOptions="CenterAndExpand" 
       HorizontalOptions="CenterAndExpand"> 
      </Image> 


     </StackLayout> 
     <StackLayout Grid.Column="1" Grid.Row="4" 
        BackgroundColor="{StaticResource MetroWhiteColor}" 
        HorizontalOptions="FillAndExpand" 
        VerticalOptions="FillAndExpand"> 
      <StackLayout BackgroundColor="{StaticResource WhiteColor}" 
         Orientation="Horizontal" 
         HorizontalOptions="FillAndExpand" 
         VerticalOptions="FillAndExpand" 
         Margin="0,1,1,1"> 
      <Label Text="Meeldetuletus" 
        FontSize="17" 
        Margin="25,0,0,0" 
        TextColor="{StaticResource BlackColor}" 
        VerticalTextAlignment="Start" 
        VerticalOptions="CenterAndExpand" 
        HorizontalOptions="Start"/> 
      <Switch IsToggled="{Binding EnableReminder, Mode=TwoWay}" 
        VerticalOptions="CenterAndExpand" 
        HorizontalOptions="Start" 
        Margin="20,0"/> 
      </StackLayout> 
     </StackLayout> 

     <!--Button--> 
     <StackLayout Grid.Column="1" Grid.Row="5" 
        Orientation="Horizontal" Margin="0,30" 
        HorizontalOptions="EndAndExpand" 
        VerticalOptions="CenterAndExpand"> 
      <xlabs:ImageButton 
          BackgroundColor="{StaticResource MetroWhiteColor}" 
          Text="SAVE" FontSize="12" 
          IsEnabled="{Binding IsValid}" 
          HorizontalOptions="StartAndExpand" 
          HeightRequest="40" 
          WidthRequest="100" 
          BorderRadius="0" 
          Command="{Binding SaveCommand}"/> 
      <xlabs:ImageButton 
          BackgroundColor="{StaticResource MetroWhiteColor}" 
          Text="CANCEL" 
          HorizontalOptions="StartAndExpand" 
          BorderRadius="0" 
          HeightRequest="40" 
          WidthRequest="100" 
          FontSize="12" 
          Command="{Binding CancelCommand}"/> 
     </StackLayout> 
     </Grid> 
    </StackLayout> 
    </ScrollView> 
</controls:BasePage> 

私はナゲットまたはUWP dosentのサポートアイコン化をしないのですか?

アイコン化のためにUWPにインストールされナゲット:

  • Xam.Plugin.Iconize.FontAwsome
  • Xam.Plugin.Iconize
  • Xam.FormsPlugin.Iconize
  • FontAwsome.UWP

答えて

1

これは既知の問題ではありませんが、現在のバージョンでは修正されていないようです。 GitHub Issue #13。私も同じ問題を経験します。

回避策は、これを行うことです。

  • プロジェクトのルート にフォルダPlugin.Iconize.Material.UWP \資産\フォント\を作成します。
  • 新しいディレクトリにfontawesome.ttfをコピーし、 をその出力としてコピーするように設定してください。
関連する問題