zIndex Frustration
I've got 5 windows in my app that I'm trying to order the zIndexes of in a specific way but to no avail. The results are completely unpredictable and inconsistent!
Before completely giving up, I'd like to see if there is anyone out there with more experience with zIndexes that might be able to give me some insight into what I may be doing wrong, i.e., are there any gotchas regarding zIndexes that one should be aware of?
6 Answers
-
This problems is still not addressed as of 1.8.
The z-index seems to be completely ignored, instead it matters what order you add the view to the window. Or in my case the order in which I add the window.
Is there a fix yet?
-
Moly answered it over an year ago, this can be achieved like this:
var image = Titanium.UI.createImageView({...}); var label = Titanium.UI.createLabel ({...}); win.add(image); win.add(label); //zIndexing image.animate({zIndex:1}); label.animate({zIndex:2});
-
In native Cocoa there's no such thing as zIndex. There's a bringToFront method, though. From my experience, I believe Appcelerator plays with it or even dispose and creates objects again (?) to enforce it's zIndex property. I couldn't manage to get it to work consistently, too. Tried it on animated ImageViews.
-
From my experience, z-index applie to views or elements in a view, not for windows
-
Thanks, Michel, for chiming in. I took your comment to heart and decided on a workaround instead that doesn't depend on having to use zIndex for windows — even thought the API documentation states that zIndex is an available property for the window class:
http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Window-object
-
Moly I'm facing the same problem you had. What was your workaround? I've tried a few thing but no luck
Thanks