noch neu in Xamarin Formen Ich versuche ein Bild hinzuzufügen.Hinzufügen eines Bildes zu Xamarin Formen
Ich habe ein neues PCL-Projekt mit einem Login-Formular und einer Hauptseite geöffnet.
Ich möchte auf der Hauptseite die 2 Bilder hinzufügen, aber eines der Bilder verursachen das Projekt zum Absturz und nannte eine unbehandelte Ausnahme.
das ist im Projekt. und fügen Sie es auch der drawable libery des Android-Projekts hinzu.
hoffe, Hilfe zu bekommen, danke.
meine XAML genannt secound Bild Anbringen tmpImage tut das Problem:
<?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:local="clr-namespace:ComplexInstruction"
x:Class="ComplexInstruction.MainPage">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0,1*"></RowDefinition>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="0.1*"></RowDefinition>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="0.1*"></RowDefinition>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="0.1*"></RowDefinition>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="0.1*"></RowDefinition>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="0.1*"></RowDefinition>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="0.1*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.1*"></ColumnDefinition>
<ColumnDefinition Width="1*"></ColumnDefinition>
<ColumnDefinition Width="0.1*"></ColumnDefinition>
<ColumnDefinition Width="1*"></ColumnDefinition>
<ColumnDefinition Width="0.1*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Aspect="Fill" Source="logo_ComplexInstructions.jpg"
RelativeLayout.WidthConstraint=
"{ConstraintExpression Type=RelativeToParent, Property=Width}"
RelativeLayout.HeightConstraint=
"{ConstraintExpression Type=RelativeToParent, Property=Height}" Opacity="0.3" Grid.ColumnSpan="5" Grid.Row="0" Grid.RowSpan="2" />
<Image x:Name="tmpImage" Aspect="Fill" Source="SHA_6620.jpg"
RelativeLayout.WidthConstraint=
"{ConstraintExpression Type=RelativeToParent, Property=Width}"
RelativeLayout.HeightConstraint=
"{ConstraintExpression Type=RelativeToParent, Property=Height}"
Grid.ColumnSpan="5" Grid.Row="3" Grid.RowSpan="8" />
</Grid>
</ContentPage>
Was sind die Abmessungen (Breite und Höhe in Pixel) Ihre Bilder? –
Was ist die genaue Ausnahme? – Jason
Ist Build Action auf 'AndroidResource' gesetzt? –