Xamarin Forms iOS image not showing from local path

Hi,

i have a problem with image control in iOS.

i have an image in "/var/mobile/Containers/Data/Application/0EC81D65-36D6-4283-A583-2A34979B0470/Documents/198361163.png"

please find my code below.

Image img = new Image();
img.Source = "/var/mobile/Containers/Data/Application/0EC81D65-36D6-4283-A583-2A34979B0470/Documents/198361163.png"

nothing appears on screen.

But the same code works pretty well when i specify images from Resource folder or remote url( http:\ ).

any idea about this issue ?

thanks in advance.

Tagged:

Posts

  • seanydaseanyda GBMember ✭✭✭✭✭

    Hi it might help if you check which solution works best like

    beachImage.Source = ImageSource.FromFile("waterfront.jpg");

    or

    beachImage.Source = ImageSource.FromResource("waterfront.jpg"); might be what you're looking for.

  • FrancoisMFrancoisM FRUniversity ✭✭

    Same issue here in xaml. Images from local path are not displayed.
    Did you solve it?

  • I am also having the same issue, I tried both options FromFile and FromResource but nothing worked. Any alternative ways to do that.

    Thanks in advance

  • @PuposeCode said:
    Hi,

    i have a problem with image control in iOS.

    i have an image in "/var/mobile/Containers/Data/Application/0EC81D65-36D6-4283-A583-2A34979B0470/Documents/198361163.png"

    please find my code below.

    Image img = new Image();
    img.Source = "/var/mobile/Containers/Data/Application/0EC81D65-36D6-4283-A583-2A34979B0470/Documents/198361163.png"

    nothing appears on screen.

    But the same code works pretty well when i specify images from Resource folder or remote url( http:\ ).

    any idea about this issue ?

    thanks in advance.

    did you found any solutions yet?

Sign In or Register to comment.