Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17939] iOS: tabGroup bar size reduced if hidden and orientation is forced to landscape

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2014-11-24T16:08:14.000+0000
Affected Version/sRelease 3.3.0, Release 3.4.0
Fix Version/sn/a
ComponentsiOS
LabelssupportTeam
ReporterMarco Cota
AssigneeIngo Muschenetz
Created2014-10-29T19:14:31.000+0000
Updated2014-11-24T16:08:14.000+0000

Description

Issue

When using a tabGroup and inside one of the tabs the window calls a new window with tabBarHidden as true and Orientation set to Landscape, we go back the TabGroup bar size will get reduced (Attachment: tabgroup.png ), if tabBarHidden is not called or set to false the issue is not present.

Steps to repro

1. Run the test code 2. Click on 'Open Landscape' 3. Close the new window either from 'Done' button or '< login' navBar button

Expected Result

Will return to the previous window and the tabGroup bar will show again.

Actual Result

Will return to the previous window but the tabGroup bar is reduced in size.

Test Code

function openTabGroup(){
	var tabGroup = Titanium.UI.createTabGroup();
	var tabs = [];
	
	for(var i=0;i<4;++i){
		var win = Ti.UI.createWindow({
			title:'login',
			backgroundColor:'#E7E7E7'
		});
	
		var goBtn = Ti.UI.createButton({
			title:'Open Landscape',
			id:i
		});
		tabs[i] = Titanium.UI.createTab({
		    id:'Tab '+i,
		    icon:'KS_nav_ui.png',
		    window:win
		});	
		
		goBtn.addEventListener('click',function(){
			var newWin = Ti.UI.createWindow({
				title:'login',
				backgroundColor:'#E7E7E7',
			    tabBarHidden : true
			});	
			
			var btnDone = Ti.UI.createButton({ title:'Done'});
		    btnDone.addEventListener('click', function(){
		        newWin.close();
		    });
		    
			newWin.add(btnDone);
			newWin.orientationModes = [ Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT ];		
			tabs[this.id].open(newWin);
		});
		
		win.add(goBtn);
		tabGroup.addTab(tabs[i]);
	}
	tabGroup.open();
}
openTabGroup();

Attachments

FileDateSize
tabgroup.png2014-10-29T19:14:32.000+000063168

Comments

  1. Marco Cota 2014-11-24

    In order to get this to work as expected the correct way is to implement is to use a modal window, here is a sample on how to get this to work, also we include a sample keeping the navigation bar(that will require a navigationWindow).
       function openTabGroup(){
       	var tabGroup = Titanium.UI.createTabGroup();
       	var tabs = [];
       	
       	for(var i=0;i<4;++i){
       		var win = Ti.UI.createWindow({
       			title:'login',
       			backgroundColor:'#E7E7E7',
       			layout:'vertical'
       		});
       	
       		var navBtn = Ti.UI.createButton({
       			top:20,
       			title:'Open Navigation Landscape',
       			id:i
       		});
       		var goBtn = Ti.UI.createButton({
       			top:20,
       			title:'Open Modal Landscape',
       			id:i
       		});
       		tabs[i] = Titanium.UI.createTab({
       		    id:'Tab '+i,
       		    icon:'KS_nav_ui.png',
       		    window:win
       		});	
       		
       		navBtn.addEventListener('click',function(){
       			var newWin = Ti.UI.createWindow({
       				title:'Chart',
       				backgroundColor:'#E7E7E7',
       			});	
       			
       			var btnDone = Ti.UI.createButton({ title:'Done'});
       		    btnDone.addEventListener('click', function(){
       		        navWin.close({animated:false});
       		    });
       		    
       			newWin.add(btnDone);	
       			var navWin = Ti.UI.iOS.createNavigationWindow({
       			    modal: true,
       				window: newWin,
       				orientationModes:[ Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT ]
       			});
       			navWin.open({animated:false});
       		});
       		
       		goBtn.addEventListener('click',function(){
       			var newWin = Ti.UI.createWindow({
       				title:'Chart',
       				backgroundColor:'#E7E7E7',
       			    tabBarHidden : false,
       			    modal:true,
                       fullscreen : false
       			});	
       			
       			var btnDone = Ti.UI.createButton({ title:'Done'});
       		    btnDone.addEventListener('click', function(){
       		        newWin.close({animated:false});
       		    });
       		    newWin.orientationModes=[ Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT ];
       			newWin.add(btnDone);		
       			newWin.open();
       		});
       		
       		win.add(goBtn);
       		win.add(navBtn);
       		tabGroup.addTab(tabs[i]);
       	}
       	tabGroup.open({animated:false});
       }
       openTabGroup();
       

JSON Source