Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1621] iOS: navBarHidden/tabBarHidden assignments do not have immediate effect

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-05-02T17:47:52.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sn/a
ComponentsiOS
Labelsapi
ReporterGlen
AssigneeIngo Muschenetz
Created2011-04-15T02:57:35.000+0000
Updated2017-06-26T17:51:45.000+0000

Description

Setting navBarHidden/tabBarHidden values only take effect once you switch to another tab.

Once they're hidden, there is no way to unhide them without closing the window. Ideally, displaying them again should be this easy:

Ti.UI.currentWindow.addEventListener('click', function(e) {
   Ti.UI.currentWindow.navBarHidden = false;
   Ti.UI.currentWindow.tabBarHidden = false;
} );

Because the effect is not immediate, making a photo gallery operate like the default iOS photos app is impossible.

Comments

  1. tom quas 2011-04-15

    I second that. Somebody recommended

       win.hideTabBar({ animated:true });
       win.tabGroup.setActiveTab(1); // hack to hide tabs
       win.tabGroup.setActiveTab(0); // and update the screen
       

    but this causes an ugly flicker.

  2. Alan Leard 2011-04-15

    Another reference ticket: http://developer.appcelerator.com/helpdesk/view/65781">http://developer.appcelerator.com/helpdesk/view/65781

    Once hiding a tabBar, no child windows can show that tabBar again.

  3. Greg Jost 2012-02-01

    Basically, you pass in your base window and tab group to subsequent windows, and do the operations above. This extremely sloppy solution works to hide the tab bar, but how do you get the tab group to show again after hiding. (e.g. go back in the navigation group stack). This doesn't work: var thisWindow = Titanium.UI.currentWindow; thisWindow._base.tabBarHidden = false; thisWindow._tabGroup.setActiveTab(1); // hack to hide tabs thisWindow._tabGroup.setActiveTab(0); // and update the screen Ti.API.info("tabBarHidden=" + thisWindow._base.tabBarHidden); Ideally, the bug would be fixed and toggling tabBarHidden would work (preferably on the current window, not the base), but I'm desperate for any solution at this point. This is ruining my application. PLEASE HELP! :)
  4. Blain Hamon 2012-06-03

    It's worth noting that the underlying native API is 'hidesBottomBarWhenPushed', and is meant to be set and forget. That is, there is no intent by Apple to hide and show the tab bar at will (The fact you can by swapping tabs is probably unintended behavior on Apple's part) and the fact no child windows will reveal the tab bar is expected behavior by Apple.
  5. Stephen Tramer 2012-07-25

    Still valid on SDK 2.2.0.f9e938d. Test code:
       var win = Ti.UI.createWindow();
       var btn = Ti.UI.createButton({
       	title:'click',
       	width:150,
       	height:50
       });
       btn.addEventListener('click', function(e) {
       	win.navBarHidden = true;
          win.tabBarHidden = true;
       });
       win.add(btn);
       
       var tg = Ti.UI.createTabGroup();
       tg.addTab(Ti.UI.createTab({
       	window:win
       }));
       tg.addTab(Ti.UI.createTab({
       	title:'click here',
       	window:Ti.UI.createWindow()
       }));
       tg.open();
       
  6. Junaid Younus 2012-08-16

    Tested on TiSDK 2.2.0v 20120816015712 using iOS simulator, issue still valid.
  7. Lee Morris 2017-05-02

    Resolving ticket as Cannot Reproduce, using the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.4 GA Appc NPM 4.2.9 Appc CLI 6.2.0 Ti CLI 5.0.12 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.7.0_80

JSON Source