Reputation: 642
Im trying to build a simply app to show an image in a stack layout, here's the code
<?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="HelloWorld.Page1">
<StackLayout BackgroundColor="White">
<Image Source="http://placehold.it/300x300"/>
</StackLayout>
</ContentPage>
but for some reason its not displaying the image at all. Can any of you see something wrong here.
Thanks!!
Upvotes: 0
Views: 780
Reputation: 5324
Possibly you don't have a well formed page?
<?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:QuickTestXAMLImage"
x:Class="QuickTestXAMLImage.MainPage">
<StackLayout BackgroundColor="White">
<Image Source="http://placehold.it/300x300"/>
</StackLayout>
</ContentPage>
Notice that I have a xmlns:local which include the local namespace of the app. It is possible you don't have a fully formed page that results in it not even loading correctly.
This works for me just fine.
Upvotes: 1