Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8875] iOS: View SIZE - some child views are not shown when view.width = Ti.UI.SIZE

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-11T00:31:02.000+0000
Affected Version/sRelease 2.0.2
Fix Version/sRelease 2.1.0, Sprint 2012-09 Core
ComponentsiOS
Labelscore, module_scrollview, qe-testadded, regression
ReporterJon Alter
AssigneeStephen Tramer
Created2012-04-24T14:56:43.000+0000
Updated2012-10-17T22:12:39.000+0000

Description

When views are added to another view which has width = Ti.UI.SIZE set, some of the child views are not displayed. This worked correctly in 1.8.2. See attached screenshot.

Steps to reproduce

Step 1: run the code below on 2.0.1.GA2 Step 2: notice that you can only see the red views that are fully on the screen Step 3: scroll to the side and notice that the rest of the red views are not there Step 4: replace Ti.UI.SIZE with 2000 and run it again Step 5: notice that all of the red views are displayed as expected

Prove this is a regression;

Step 1: "width = 'auto'" in 1.8.2 is the same as "width = Ti.UI.SIZE" in 2.0.1 (they both shrink to the size of their children) Step 2: in the code below comment out "width: Ti.UI.SIZE," and use "width: 'auto'," instead Step 3: run this edited code with 1.8.2 and notice that all of the red views are displayed as expected (see screenshot)
var win = Ti.UI.createWindow({backgroundColor:'white'});
win.open();

var scrollView = Ti.UI.createScrollView({
	contentWidth: 2000,
	backgroundColor: 'black',
	layout: 'horizontal'
});
win.add(scrollView);

var view1 = Ti.UI.createView({
	backgroundColor: 'blue',
	height: 400,
	// for 2.0
	width: Ti.UI.SIZE,
	// for 1.8
	// width: 'auto',
	layout: 'horizontal'
});
scrollView.add(view1);

for(var i = 0, j = 20; i < j; i++){
	view1.add(Ti.UI.createView({
		backgroundColor: 'red',
		width: 100,
		height: 400,
		left: 40
	}));
}

Attachments

FileDateSize
2.0.1.broken.jpg2012-04-24T14:56:43.000+000072652

Comments

  1. Max Stepanov 2012-04-26

    Fixed by PR 2073 for TIMOB-8773 TIMOB-8775
  2. Michael Pettiford 2012-06-19

    Closing issue Tested with Ti Studio build 2.1.0.201206172244 Ti Mobile SDK 2.1.0.v20120618154152 hash r7830c03d OSX Lion 10.7.3 iPhone 4S OS 5.1 The expected behavior is shown
  3. Anshu Mittal 2012-07-11

    Reopening to update labels

JSON Source