Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5184] iOS: ToolBar missing its content (buttons) while orientation change on ScrollableView

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-06-09T17:41:21.000+0000
Affected Version/sRelease 1.7.2, Release 2.0.1, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
LabelsParity, api
ReporterKarol Pomaski
AssigneeIngo Muschenetz
Created2011-08-31T15:12:13.000+0000
Updated2017-06-09T17:41:21.000+0000

Description

Problem

When we have more than 5 views inside the ScrollableView and in every view different instance of ToolBar than after changing the orientation some of the ToolBars are missing their content/components (buttons, labels). Please see the screenshots.

Reproducible Steps

1. Execute the attached code. 2. Stay with Portrait orientation 3. Go to the 6th view 4. Change from Portrait orientation into Landscape and than go back to Portrait 5. Go back to the 5th view 6. Now you can see an empty ToolBar - the components that were there are missing (buttons, labels)

Regression

Works correctly with SDK 1.6.3

Sample Code

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');



var scrollable = Titanium.UI.createScrollableView({
		showPagingControl:true,
		currentPage:0,
		contentWidth:320,
	    contentHeight:640,
	    top:0,
	    left:0,
	    right:0,
	    bottom:0,
	    showVerticalScrollIndicator:false,
	    showHorizontalScrollIndicator:false,
	    backgroundColor: "#ccc"
	});

//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
win1.orientationModes = [
	Titanium.UI.PORTRAIT,
	Titanium.UI.LANDSCAPE_LEFT,
	Titanium.UI.LANDSCAPE_RIGHT,
	Titanium.UI.UPSIDE_PORTRAIT
];
label = {};
setup = {};
info = {};
back = {};
space1 = {};
space2 = {};

for(i=0; i<6; i++) label[i] = Titanium.UI.createLabel({text:"Photo #", color:'#fff'});
for(i=0; i<6; i++) space1[i] = Titanium.UI.createButton({systemButton: Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE});
for(i=0; i<6; i++) space2[i] = Titanium.UI.createButton({systemButton: Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE});
for(i=0; i<6; i++) setup[i] = Titanium.UI.createButtonBar({labels:['Setup'], style:Titanium.UI.iPhone.SystemButtonStyle.BAR});
for(i=0; i<6; i++) info[i] = Titanium.UI.createButtonBar({labels:['Info'], style:Titanium.UI.iPhone.SystemButtonStyle.BAR});
for(i=0; i<6; i++) back[i] = Titanium.UI.createButtonBar({labels:['Back'], style:Titanium.UI.iPhone.SystemButtonStyle.BAR});

topBar = {};
for(i=0; i<6; i++) topBar[i] = Titanium.UI.createToolbar({items:[back[i], space1[i], label[i], space2[i], setup[i], info[i]], left:0, right:0, top:0, height:5, barColor:'#000', opacity:0.6});

var w1 = Ti.UI.createView();
var w2 = Ti.UI.createView();
var w3 = Ti.UI.createView();
var w4 = Ti.UI.createView();
var w5 = Ti.UI.createView();
var w6 = Ti.UI.createView();
w1.add(topBar[0]);
w2.add(topBar[1]);
w3.add(topBar[2]);
w4.add(topBar[3]);
w5.add(topBar[4]);
w6.add(topBar[5]);

scrollable.views = [w1,w2,w3,w4,w5,w6];

win1.add(scrollable);
win1.open();

Associated Helpdesk ticket

http://appc.me/c/APP-659713

Attachments

FileDateSize
1.png2011-08-31T15:12:13.000+000094529
2.png2011-08-31T15:12:13.000+000099803
3.png2011-08-31T15:12:13.000+000087007
tabs.zip2011-08-31T15:12:13.000+00001580577

Comments

  1. Nikhil Sharma 2012-05-16

    still bug - tested with Ti SDK 2.0.1.GA2, still an issue.
  2. jithinpv 2013-05-09

    issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 iOS iPhone Simulator: iOS SDK version: 6.0
  3. Lee Morris 2017-06-09

    Closing this ticket as the issue cannot be reproduced with the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170606103146 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source