开发者

how can i use use local images in my titanium project

开发者 https://www.devze.com 2023-04-12 18:49 出处:网络
i\'m trying to change my background of a window in titanium , unfortuantly its not working. i also tried to use 开发者_JS百科many local images and they did\'t load. any help is highly appreciated

i'm trying to change my background of a window in titanium , unfortuantly its not working. i also tried to use 开发者_JS百科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',
});


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号