user3769778
user3769778

Reputation: 967

Cannot load image from local file system in Nativescript?

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 :

enter image description here

It just loads as such without image:

enter image description here

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>.

Upvotes: 0

Views: 361

Answers (1)

Manoj
Manoj

Reputation: 21908

Your images or anything you want to pack with app should be placed inside app folder.

Upvotes: 2

Related Questions