Problem
If you specify a barImage on a window in a nav group, that image never goes away. Subsequent images will stack. Nav bar contents like titles or buttons will show up behind them.
Sample Code
Drop the following in an app.js. It only needs "appicon.png" in your resources directory. To reproduce:
1. Look at the nav bar (it is OK)
2. Touch "Open Child 2"
3. Touch "Child 1" (it's a back button in the top left)
4. Look at the nav bar (the bar image from the child is there)
5. Rotate the device 90 degrees
6. Touch "Open Child 2"
7. Look at the nav bar (the portrait bar image is there, plus a new landscape bar image, and the title is hidden)
var parent = Ti.UI.createWindow({
navBarHidden: true, modal: true
});
var child1 = Ti.UI.createWindow({
title: 'Child 1'
});
child1.setRightNavButton(Ti.UI.createButton({
systemButton: Ti.UI.iPhone.SystemButton.DONE
}));
var nav = Ti.UI.iPhone.createNavigationGroup({
window: child1
});
parent.add(nav);
var openNewChildButton = Ti.UI.createButton({ title: 'Open Child 2' });
openNewChildButton.addEventListener('click', function() {
var child2 = Ti.UI.createWindow({ title: 'Child 2', barImage: 'appicon.png', barColor: '#000' });
nav.open(child2);
});
child1.add(openNewChildButton);
parent.open();
Possibly Related To
[TIMOB-2834]
Associated Helpdesk Ticket
http://appc.me/c/APP-115938
When testing, test for a regression of TIMOB 3770. If there's other tests that involve blurs on close, those might be good as well.
Pull request 262 does provide a fix, but the navbar image is present after the animation and redraw of the original window. If possible, it would be best to remove the image prior to animating and redrawing the first window.
I'm going to have to go with 'intentional design'. The behavior of not removing the graphic until the window is fully closed is to avoid the tab graphics flickering if both windows happen to have the same graphic. The full and utterly correct solution requires more work into NavGroup and Tab, and should be tabled for later.
Tested On: Mac OSX Lion TiMob: 1.8.0v20110819142548 TiStud: 1.0.4.201108101535 Devices: iPhone4 version 4.2.10 iPad2 version 4.3.5 iPod 3
This issue persists if you have a 3rd window (and presumably more windows after that). Parent - barImage and custom nav buttons work Child - barImage and custom nav buttons work Grandchild - barImage covers nav buttons Simply add an additional window to the sample code on this ticket to reproduce the issue.
Oh, and I'm using Titanium Mobile 1.8.2