2017-11-18 3 views
-1

私はxamarin.formsを使用してアプリケーションを開発し、アンドロイドでのみテストしました。 IveはiOSのテストを開始しました。使用しているすべての画像をAndroidリソースのドロワブルフォルダからiOSリソースフォルダにコピーしました。シミュレータのデバッグ中に私のアプリが壊れ続けます: "System.ArgumentNullExceptionがスローされました。値はnullではありません。パラメータ名:image"私は100キロバイトの下にすべての私の画像をリサイズSystem.ArgumentNullException xamarin.forms

  • を試してみた何

  • xamlのすべての画像参照がそれぞれ pngまたはjpgで終わることを確認しました。

この例外を引き起こす可能性のあるものが他にありますか。どんな助けもありがとう。

XAMLページに私はあなたが
「BundleResource」にイオス/リソースの各画像ファイルのビルドアクションを設定する必要が

<?xml version="1.0" encoding="utf-8" ?> 
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
       x:Class="LoyaltyWorx.GridMenu" 
       BackgroundImage="grid.jpg" 
       Title="Main Menu" 
       > 
     <Grid> 
      <Grid.RowDefinitions> 
       <RowDefinition Height="*" /> 
       <RowDefinition Height="2*" /> 
       <RowDefinition Height="*" /> 
      </Grid.RowDefinitions> 
      <Grid.ColumnDefinitions> 
       <ColumnDefinition Width="1*" /> 
       <ColumnDefinition Width="2*" /> 
      </Grid.ColumnDefinitions> 
      <Label Text="Cards" TextColor="White" FontAttributes="Bold" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Row="0" Grid.Column="0" BackgroundColor="#1481BA" Opacity="0.5" x:Name="CardTile"/> 
      <Label Text="Transactions" TextColor="Black" FontAttributes="Bold" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Row="0" Grid.Column="1" BackgroundColor="#ede890" Opacity="0.5" x:Name="TransactionTile"/> 
      <Label Text="Promotions" TextColor="White" FontSize="30" FontAttributes="Bold" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Row="1" Grid.Column="0" BackgroundColor="#1481BA" Grid.ColumnSpan="2" Opacity="0.7" x:Name="PromoTile"/> 
      <Label Text="Settings" TextColor="Black" FontAttributes="Bold" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Row="2" Grid.Column="0" BackgroundColor="#ede890" Opacity="0.5" x:Name="SettingsTile" /> 
      <Label Text="My Profile" TextColor="White" FontAttributes="Bold" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Row="2" Grid.Column="1" BackgroundColor="#1481BA" Opacity="0.7" x:Name="ProfileTile"/> 
     </Grid> 
    </ContentPage> 
+0

誰も私の悪い、チェックコード –

+0

の行せずにあなたを助けることはできませんBackgroundImage = "grid.jpg"を削除すると私の編集 –

+0

が機能しますか? –

答えて

0

に移動カント。 Android用


AndroidResource
(とAndroidのために、それは描画可能なフォルダ内のサブフォルダのいずれかの種類を受け付けません)