4

I have this code in my app.js file in android and an images folder in my resources:

var win = Titanium.UI.createWindow({

    title : "my Name is Reyjohn",
    backgroundColor : "#FFFFFF",

    exitOnClose : true

})


var img = Titanium.UI.createImageView({


    image:"images/Hypedin.png",
    height:20,
    width:30


});


win.add(img);

win.open();

but its not showing any image in background, where did I do wrong? I am new in titanium, please help

Reyjohn
  • 2,654
  • 9
  • 37
  • 63

2 Answers2

6

Try to add another / to the Path like:

image:"/images/Hypedin.png",

You can also try to set the correct Positioning:

top: 0,
left: 0

Did you check the Log/Output? Is there any Error?

riyuk
  • 174
  • 1
  • 6
1

Nothing wrong with your code. Check and make sure that, images/Hypedin.png is there with correct spelling. Could be a typo.

NoNaMe
  • 6,020
  • 30
  • 82
  • 110
Rishi
  • 40
  • 1
  • 7