Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10335] iOS: Size issue when changing a tabbedBar in Toolbar to visible from invisible

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-19T12:27:56.000+0000
Affected Version/sRelease 2.0.2
Fix Version/sn/a
ComponentsiOS
Labelscore, exalture, layout
ReporterFederico Casali
Assigneesrikanth ravipati
Created2012-06-19T00:54:10.000+0000
Updated2017-03-20T16:40:06.000+0000

Description

Problem description

Size issue when changing a tabbedBar in a Toolbar to visible from invisible

Steps to reproduce

Run the sample code below. First tabbedBar it's invisible. When set to visible, it actually expand to the maximum Toolbar size. This is not reproducible using TiSDK 2.0.1.v20120412163344 It's reproducible from 2.0.2 GA

Sample code

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
var win = Titanium.UI.createWindow({
	layout : 'vertical'
});


var btn = Ti.UI.createButton({
	title : 'Toggle!'
});

var tabbedBar1 = Ti.UI.iOS.createTabbedBar({
	labels : ['One', 'Two'],
	visible: false
});

//tabbedBar1.visible = vis;

var tabbedBar2 = Ti.UI.iOS.createTabbedBar({
	labels : ['Three', 'Four']
});

var flexSpace = Ti.UI.createButton({
	systemButton : Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
});

btn.addEventListener('click', function(e){
	if(tabbedBar1.visible == false){
		tabbedBar1.visible = true;
	} else {
		tabbedBar1.visible = false;
	}
	Ti.API.info(tabbedBar1.visible);
});

win.add(btn);
win.setToolbar([tabbedBar1, flexSpace, tabbedBar2]);

win.open({
	modal : true
}); 

Comments

  1. Carter Lathrop 2012-07-20

    Can you please point out what the steps are to reproduce this bug? Is the repositioning of the tabbedBar the bug? Or is that a something that happens in the code? Please be more clear in the description, and as always, samples of test code to show the error make your point much more clear and easy to fix.
  2. Carter Lathrop 2012-07-20

    Gionvani, I am posting some code that I think may be the bug you are experiencing please respond confirming this is the behavior you are describing. Thank you. Carter
  3. Carter Lathrop 2012-07-20

    Giovani, Here is a workaround that will fix this problem for the meantime. I am moving this bug to TiMob and will respond shortly with the ticket information. Thank you for bringing this to our attention. Thanks, Carter
       var win = Titanium.UI.createWindow({
         layout : 'vertical'
       });
       
       
       var btn = Ti.UI.createButton({
         title : 'Toggle!'
       });
       
       var tabbedBar1 = Ti.UI.iOS.createTabbedBar({
         labels : ['One', 'Two']
       });
       
       //tabbedBar1.visible = vis;
       
       var tabbedBar2 = Ti.UI.iOS.createTabbedBar({
         labels : ['Three', 'Four']
       });
       
       var flexSpace = Ti.UI.createButton({
         systemButton : Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
       });
       
       var visible = false;
       
       btn.addEventListener('click', function(e){
         if(visible){
       		win.setToolbar([tabbedBar1, flexSpace, tabbedBar2]);
         } else {
       		win.setToolbar([flexSpace, tabbedBar2]);
         }
         visible = !visible;
         Ti.API.info(visible);
       });
       
       win.add(btn);
       win.setToolbar([tabbedBar1, flexSpace, tabbedBar2]);
       
       win.open({
         modal : true
       });
       
  4. srikanth ravipati 2013-03-19

    it is already fix in 3.0.2.
  5. Lee Morris 2017-03-20

    Closing ticket as the issue cannot be reproduced.

JSON Source