I have added a button to my window via rightNavButton, the window is a child of a tabGroup. When returning to the window after visiting another tab the button disappears. Subsequent windows with this button added in the same manner behave as expected.
Any ideas?
3 Answers
Accepted Answer
So I find a solution:
win.addEventListener('focus', function (e) { var t = e.source.rightNavButton; e.source.rightNavButton =null; e.source.rightNavButton=t; });This restores the rightNavButton every time the windows gets focused. Works with a barImage and a label as titleControl. Tested with Titanium SDK 1.8.2.
I think I figured this out. It took a long time and a lot of headache but what I've discovered is that you can't use both a custom rightNavBar and window.barImage at the same time. I have no idea why and it might be a bug but when you go back in the navigation hierarchy the rightNavButton drops behind the barImage. Remove that and you should be golden!
Also just to clarify, I'm adding the rightNavButton to every page via a global header instead of passing it through to each window when it's declared. And I tried creating and adding the rightNavButton after setting the barImage but to no avail, you simply can't have both at once for some reason.
What did you mean with "I'm adding the rightNavButton to every page via a global header"?
Your Answer
Think you can help? Login to answer this question!