navGroup - 1 win no navBar; 1 with navBar
I am trying to create a navGroup where the 1st window has no navBar, and upon pressing a button, the 2nd window slides in and has a navBar, so the user can return to the previous window. All is working fine, but when I select the back button to return, the area where the navBar was on the second screen turns black (the bkgd color) before sliding to win1. This doesn't look very good! Is there a better way to handle what I am trying to achieve? I've only been using Titanium for a few days now and could use some insight. I looked through KitchenSink, but can't find anything similar. Thanks for any replies. My code is as follows:
var win = Ti.UI.createWindow();
var win1 = Ti.UI.createWindow({
backgroundColor:'red',
title:'Red Window',
navBarHidden:'true'
});
var win2 = Ti.UI.createWindow({
backgroundColor:'red',
title:'Blue Window'
});
var nav = Ti.UI.iPhone.createNavigationGroup({
window: win1
});
var testBtn = Ti.UI.createButton({
title:'test',
color:'#000',
font:{fontSize:15, fontWeight:'bold', fontFamily:'Helvetica Neue'},
top:110,
height:34,
width:160
});
testBtn.addEventListener('click', function(e){
nav.open(win2);
win2.showNavBar();
});
win2.addEventListener('open', function(e){
Ti.API.info('win2 open');
});
win1.add(testBtn);
win.add(nav);
win.open();
1 Answer
-
You need to set the background color of the navgroup