Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7613] Custom barImage with Tab sub navigation displays previous barImage, not the current window barImage

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2012-02-14T23:35:17.000+0000
Affected Version/sRelease 1.8.0.1, Release 2.0.0, Release 1.8.1
Fix Version/sSprint 2012-04, Release 2.0.0, Release 1.8.2
ComponentsiOS
LabelsbarImage, module_tabbedbar, parity, qe-testadded
ReporterMatt Bryson
AssigneeVishal Duggal
Created2012-02-03T16:28:08.000+0000
Updated2012-03-03T22:56:26.000+0000

Description

Problem description

When you create a tab with two windows with different barImages, you will get the first barImage in the second window as well, even if it has a different barImage defined. In the animation, the second barImage will show, producing an non desired color effect.

Actual results

You will only see the barImage defined in the first window.

Expected results

Each window should have their own barImage shown.

Test case

Create a tabNavigation group with 1 tab. Add a custom barImage to the main window. Open a sub window with tabGroup.currentTab.open. That sub window contains a different barImage. The correct bar image appears on 2nd window. Press back button Then navigate to the the second window AGAIN This time the root window bar image is present and NOT the 2nd window bar image.
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

// create tab group
var tabGroup = Titanium.UI.createTabGroup();


//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff',
    barImage:'nav_bg.png',
    tabBarHidden:true
});

var button = Ti.UI.createButton({
	title:'open',
	width:100,
	height:50
});

button.addEventListener('click', function() {
	//win2.open();
	tabGroup.activeTab.open( win2 );
})

win1.add(button);

var win2 = Titanium.UI.createWindow({  
    title:'Tab 2',
    backgroundColor:'#fff',
    barImage:'nav_bg_2.png',
});

var tab1 = Titanium.UI.createTab({  
    title:'Tab 1',
    window:win1
});


tabGroup.addTab(tab1);  

// open tab group
tabGroup.open();

Extra info

The attached project includes above code and two images.

Attachments

FileDateSize
nav_bg_2.png2012-02-10T11:04:33.000+000010531
nav_bg.png2012-02-10T11:04:33.000+00009720
testTabBug.zip2012-02-03T17:17:42.000+00001674283

Comments

  1. Matt Bryson 2012-02-03

    I have added a sample project that does this, in fact, in the sample its worse, it shows the 2nd bar image as the window animates on, and then reverts to the first one.
  2. Mauro Parra-Miranda 2012-02-10

    The barImages for the example
  3. Vishal Duggal 2012-02-13

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/1406
  4. Michael Pettiford 2012-02-13

    Closing issue Tested with Ti Studio build 1.0.8.201201262211 Ti Mob SDK 1.9.0.v20120212011634 OSX Lion 10.7.3 iPhone 4S OS 5.0.1 Verified that the expected results are shown

JSON Source