Set background image for my Titanium view
-
29-10-2019 - |
Question
How do I set my background image for my view as for example http://bluebackground.com/__oneclick_uploads/2008/04/blue_background_03.jpg ?
I knew how to do it from local folder something like backgroundImage:'images/bg.png', but how do I fetch using http and set it as my background?
Solution
You can set image like :
view.backgroundImage="http://bluebackground.com/__oneclick_uploads/2008/04/blue_background_03.jpg";
This will take some time in downloading image and set it.
Hope this helps you.
OTHER TIPS
Pls Try this set image on top corner...
var bgImage = Ti.UI.createImageView({ height : 'auto', width : 'auto', top : 0, left : 0, image : 'images/h-5.jpg' }); win.add(bgImage);
If the image is on the web you may want to simply try creating a full sized image view with the URL and a low zIndex and adding it to your window.