0

Im trying to learn xamarin and to make a UI in xamarin forms. I trying to add <image/>but when I add more than 2 line of code <image/> I get this error An unhandled exception occured and I don't know why. I tried to search for a solution but I don't have any luck to solve it. Please how can I resolve this?

my 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"
         x:Class="MyMenu.Home"
         Title ="Home">
<ScrollView>
    <Grid RowSpacing="0">
        <Grid.RowDefinitions>
            <RowDefinition Height="180"/>
            <RowDefinition Height="180"/>
            <RowDefinition Height="180"/>
            <RowDefinition Height="180"/>
        </Grid.RowDefinitions>
        <Image Grid.Row="0" Aspect="AspectFill" Source="order.jpg"/>
        <Image Grid.Row="1" Aspect="AspectFill" Source="loyaltycard.jpg"/>
        <Image Grid.Row="2" Aspect="AspectFill" Source="coupon.jpg"/>
        <Image Grid.Row="3" Aspect="AspectFill" Source="photo.jpg"/>
    </Grid>
</ScrollView>

  • Have a look at [https://stackoverflow.com/questions/4523609/grid-of-images-inside-scrollview](https://stackoverflow.com/questions/4523609/grid-of-images-inside-scrollview) – lloyd Dec 01 '17 at 05:21
  • Do you add the corresponding rows? – ProgrammingLlama Dec 01 '17 at 05:21
  • @lloyd that link does not apply to Xamarin Forms – Jason Dec 01 '17 at 05:24
  • why can't you do a google search ? you could have found this by now https://developer.xamarin.com/guides/xamarin-forms/user-interface/images/ – MethodMan Dec 01 '17 at 05:48
  • @MethodMan And how does your link relate to the OPs issue? – Paul Kertscher Dec 01 '17 at 05:57
  • 1
    Try adding `try / catch` around the call to `InitializeComponent` in the constructor in `Home.xaml.cs`. Unfortunately VisualStudio is not too verbose about Xamarin exceptions and they are sometimes a bit hard to track down. – Paul Kertscher Dec 01 '17 at 06:05

0 Answers0