Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Native Script is not showing res:// image

I'm following the NativeScript tutorial, but when I'm trying to load the image with res:// is not working with iOS.

<Image src="res://logo" stretch ="none" />

The file is in the App_Resources/iOS/logo.png

UPDATE:

Now works:

1.- Uninstall the app from the device/emulator

2.- Then do a new tns build ios to get a fresh build

like image 367
eusoj Avatar asked Jun 07 '16 19:06

eusoj


2 Answers

Related steps for the same issue but with Android.

tns platform remove Android
tns platform add Android
tns run Android

Added explanation: The issue here is that your app isn't really running from AppResources. It is actually running from platform/ios and platform/android, both of which are compiled during a fresh build.

So when you add an image under AppResources, great, but unless you rebuild the app is still running on outdated resources found in platform/ios and platform/android.

Removing the platforms and adding the platforms will ensure the folders your app is using mimic App Resources. And your image will be available.

like image 73
farrellw Avatar answered Oct 07 '22 23:10

farrellw


It worked for me.

  1. Uninstall the app from the emulator
  2. Re-run your build / livesync
  3. Done
like image 38
Tony Avatar answered Oct 08 '22 00:10

Tony