Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8881] iOS: scrollView - contentWidth and contentHeight only respond to "auto" not Ti.UI.SIZE

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-05-29T16:39:13.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-11 Core
ComponentsiOS
Labelscore, module_scrollview, qe-testadded
ReporterJon Alter
AssigneeNeeraj Gupta
Created2012-04-25T09:11:58.000+0000
Updated2012-07-09T15:59:35.000+0000

Description

scrollView.contentWidth only responds to "auto" and not Ti.UI.SIZE as you would expect with the composite layout changes. This creates an inconsistent experience for developers.

Steps to reproduce:

Step 1: run the code below Step 2: notice that the contentWidth is set to "auto" and is resizing as it should Step 3: replace "auto" with Ti.UI.SIZE Step 4: run the code again Step 5: notice that the scrollView does not scroll. This means that the contentWidth does not resize as you would expect it to with Ti.UI.SIZE
var win = Ti.UI.createWindow({backgroundColor:'white'});
win.open();
 
var scrollView = Ti.UI.createScrollView({
    contentWidth: 'auto',
    // contentWidth: Ti.UI.SIZE,
    backgroundColor: 'black',
    layout: 'horizontal'
});
win.add(scrollView);
 
for(var i = 0, j = 20; i < j; i++){
    scrollView.add(Ti.UI.createView({
        backgroundColor: 'red',
        width: 100,
        height: 400,
        left: 40
    }));
}

Comments

  1. Max Stepanov 2012-05-29

    Fixed by PR 2073
  2. Michael Pettiford 2012-06-18

    Closing issue Tested with Ti Studio build 2.1.0.201206172244 Ti Mobile SDK2.1.0.v20120618134156 hash r00905cd0 OSX Lion 10.7.3 iPhone 4S OS 5.1 The expected behavior is shown

JSON Source