Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4355] iOS: barImages Stack (and Never Go Away)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-10-27T15:44:40.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sSprint 2011-29, Release 1.8.0
ComponentsiOS
Labelsn/a
ReporterDawson Toth
AssigneeBlain Hamon
Created2011-06-09T12:53:44.000+0000
Updated2012-04-13T09:11:23.000+0000

Description

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

Comments

  1. Blain Hamon 2011-07-19

    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.
  2. Eric Merriman 2011-07-21

    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.
  3. Blain Hamon 2011-07-25

    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.
  4. Vikramjeet Singh 2011-08-29

    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
  5. Clifton Labrum 2012-04-13

    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.
  6. Clifton Labrum 2012-04-13

    Oh, and I'm using Titanium Mobile 1.8.2

JSON Source