hello ,
I have a window that contains a tableview and when I click on the line I have a window that opens and contains the navbar
then I want to hide this navbar but I do not know how I do I try to use me navBarHidden but it also hides the navbar of the window containing my tableview me while I just want to hide the window of s 'opens after clicking on a line
here is the code that should open the window after the click event
var videoWindow = Titanium.UI.createWindow({ title: '', //navBarHidden:true, tabBarHidden: true, backgroundColor: '#111' });
4 Answers
I believe I have seen this behavior as well. It seems like navBarHidden effects all windows in the navigation group. Its not ideal, but here's a basic example that shows how you can work around this. In particular, notice that in the button2 click handler I set win1.navBarHidden = false; again. A bit of a hack, but it works.
var win = Ti.UI.createWindow(); // first window in navigation group var win1 = Ti.UI.createWindow({ title:'win1' }); var button = Ti.UI.createButton({ title:'go to win2', width:100, height:40 }); button.addEventListener('click', function(e) { nav.open(win2); }); win1.add(button); // second window in naigation group var win2 = Ti.UI.createWindow({ title:'win2', navBarHidden:true }); var button2 = Ti.UI.createButton({ title:'back to win1', width:100, height:40 }); button2.addEventListener('click', function(e) { nav.close(win2); //This will show your nav bar again win1.navBarHidden = false; }); win2.add(button2); // setup navigation group var nav = Ti.UI.iPhone.createNavigationGroup({ window:win1 }); win.add(nav); win.open();
the window that contains the tabgroup
(function(){ app.ui.createVodWindow = function(){ var interServices = new app.model.InterServices(); // create tab group var tabGroup = Titanium.UI.createTabGroup({ barColor: 'black' }); var winVod= Titanium.UI.createWindow({ title:'', tabBarHidden: true, barColor:'black', backgroundColor:'white' }); /*tab1*/ var winR = Titanium.UI.createWindow({ title: 'R', backgroundColor: 'white' }); var tabR = Titanium.UI.createTab({ icon: 'images/icons/recentes_on.png', title: 'R', window: winR }); /*tab2*/ var winE = Titanium.UI.createWindow({ title: 'E', backgroundColor: 'white' }); var tabE = Titanium.UI.createTab({ icon: 'images/icons/emissions_on.png', title: 'E', window: winE }); /*tab3*/ var winT = Titanium.UI.createWindow({ title: 'T', backgroundColor: 'white' }); var tabT = Titanium.UI.createTab({ icon: 'images/icons/themes_on.png', title: 'T', window: winT }); tabGroup.addTab(tabR); tabGroup.addTab(tabE); tabGroup.addTab(tabT); return tabGroup; }; })();the window should open after clicking on the line of which is in the tableview tab1
(function() { app.ui.createVideoRecentesTabGroup = function(videoR) { var interactivServices = new app.model.InteractivServices(); var videoRecentes = videoR; var videoRecentesWindow = Titanium.UI.createWindow({ title: '', // navBarHidden:true, tabBarHidden: true, backgroundColor: '#111', });thank you
after you created videoWindow and before you open it set videoWindow.hideNavBar();
Lik Stefano and I stated above, it is a simple matter of setting navBarHidden = true on your video window before you open it, and then setting navBarHidden = false on your original window before you go back to it. This will solve your problem. How you implement that within your existing navigation and app logic is up to you.
Your Answer
Think you can help? Login to answer this question!