ImageView not showing in android titanium

I have this code in my app.js file in android and the image 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 not showing the image in the background, where did I make a mistake? I'm new to titanium, please help

+4
source share
2 answers

There is nothing wrong with the code. Check and verify that images/Hypedin.png exists with the correct spelling. Could be a typo.

+1
source

Try adding another path to the following path:

 image:"/images/Hypedin.png", 

You can also try to set the correct positioning:

 top: 0, left: 0 

Have you checked Log / Output? Is there a mistake?

+6
source

Source: https://habr.com/ru/post/1412182/


All Articles