Iyad Al aqel
Iyad Al aqel

Reputation: 2022

how can i use use local images in my titanium project

i'm trying to change my background of a window in titanium , unfortuantly its not working. i also tried to use many local images and they did't load. any help is highly appreciated ,How can use my resources ?

var win1 = Titanium.UI.createWindow({  
title:'Hello',
backgroundImage:'back.png',
});

Upvotes: 1

Views: 911

Answers (1)

Rene Pot
Rene Pot

Reputation: 24815

You can do that, just like that. backgroundImage is supported on window.

Just make sure you use the right path:

backgroundImage: Ti.FileSystem.resourcesDirectory + 'back.png'

Here I am assuming back.png (case sensitive) is actually in the resources directory root.

Upvotes: 1

Related Questions