Label over Image
I'm trying to put a Label over createImageView(), but doesn't work, the Image always appear over the Label, already try with zIndex but don't work too. Any ideas ?
The code:
var gallImg = Ti.UI.createImageView({
url: photos[i].thumb,
width:210,
height:140,
zIndex: -1
});
var title = Titanium.UI.createLabel({
text: photos[i].title + ' (' + photos[i].publish + ')',
backgroundColor: '#000000',
width:210,
height:50,
bottom: 'bottom',
color:'#ffffff',
textAlign:'left',
zIndex: 5
});
gallImg.add(title);
Also doesn't work when adding a ImageView() over another ImageView()
Thanks in advanced
2 Answers
-
Accepted Answer
You are adding a label to an image, is not good
create a "view", add the image to the view, add the label to the view.
-
wait….
if you have a view or window… create and add the imageView to it first, then create and add the label (to the view or window, not the image view) and you should be fine…. all without any need for zIndex