Cannot load image from local file system in Nativescript using the Image tag


#1

Hi All,

I am not able to load local image from file system using Image tag.

<Page 
xmlns="http://www.nativescript.org/tns.xsd" loaded="onLoaded" navigatedTo="onNavigatedTo">
<StackLayout>
    <Label text="Test above" textWrap="true" />
    <Image src="~/images/Apps-Android-icon.png" stretch="none" />
    <Label text="text below" textWrap="true" />
</StackLayout>

This is my view and my images are kept in here :

It just loads as such without image:

I refereed the official docs and it says the same specifications.
What am I doing wrong and why its not loading ?

I am running it in Android emulator <5.1_WVGA_API_22>.


#2

You suppose to place your images inside app folder not project root folder.