Sunday, 12 September 2021

Xamarin Forms / Mobile Blazor Bindings - Images not displaying in iOS app, but fine in Android app

The Problem

I have a simple sample app using Mobile Blazor Bindings, but I am getting inconsistent behaviour between the Android and the iOS version when it comes to display a simple image (.png).

Android App

Sample image shows as expected in the Android version of the app.

Page in Android App

iOS App

Same sample image does not display in iOS version of the app. Page in iOS App

The Test Image page

The razor page consists only of 2 HTML lines (no C# code).

<h3>Test Image</h3>

<img src="Images/Image.png" style="max-width: 100%;"/>

The image file Image.png is located within the Blazor project, within wwwroot\Images

Image file in VS Project

And the image file is set to "Copy always" to the Output Directory:

enter image description here

Can anyone offer any advice on what is going on?

Many thanks in anticipation.



from Xamarin Forms / Mobile Blazor Bindings - Images not displaying in iOS app, but fine in Android app

No comments:

Post a Comment