Xamarin Forms - Image source not working from url
What is your output from visual studio. I ran into a similar issue loading images from passed uris. It turned out to be a header needed in the manifest.
<application
android:usesCleartextTraffic="true">
...
</application>```
I got this problem before and it have to do with the server not adding the right header.
The best solution i got is to create a Converter that download the image. as your variant 3.
Here is what i did.
public class ImageSourceConverter : IValueConverter
{
static WebClient Client = new WebClient();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
return null;
var byteArray = Client.DownloadData(value.ToString());
return ImageSource.FromStream(() => new MemoryStream(byteArray));
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
// And the xaml
<Image Source="{Binding ImageUrl, Converter={StaticResource ImageSourceConverter}}" />