Youssef13
Youssef13

Reputation: 4986

Image not shown in Xamarin android

This is the content of my .xaml file:

<?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:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             x:Class="App1.MainPage">

    <StackLayout>
        <Label Text="HelloWorld"></Label>
        <Image Source="https://placehold.it/100"></Image>
    </StackLayout>

</ContentPage>

This is how it looks:

enter image description here

And this is my project settings:

enter image description here

I don't have a mac to see if the problem exists in iOS or not.

Upvotes: 0

Views: 173

Answers (2)

Youssef13
Youssef13

Reputation: 4986

Updating from Xamarin.Forms 4.2 to Xamarin.Forms 4.3 fixed it.

Upvotes: 2

Paolo Ardissone
Paolo Ardissone

Reputation: 847

It's a common issue. In the majority of the cases this is due to a bad link. Try an url where the extension of the image is specified like this:

"https://secure.webtoolhub.com/static/resources/icons/set113/55ba4962.png"

or, instead, try to add '.png' at the end of the url you're currently using.

I've noticed that if you use an url where the extension is not specified, the application has some issue to renderize the image.

Upvotes: 0

Related Questions