{ "id": "62275", "key": "TIMOB-1643", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11239", "name": "Release 1.6.0 M06", "archived": true, "released": true, "releaseDate": "2011-01-24" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:56:45.000+0000", "created": "2011-04-15T02:58:09.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "defect", "ios", "release-1.6.0", "scrollview" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:56:45.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

Ok, if a scrollview is placed in a window and more than 10 child\nviews are added, any new children views added cause the app to\nfreeze.

\n

Another scenario is that if the window is opened before child\nviews are added to the scroll view, only 10 views can be added\nwithout causing a freeze. The code below demonstrates this.

\n

var win = Ti.UI.currentWindow;

\n

var scrollView = Titanium.UI.createScrollView({
\nborderSize: 1, borderColor: 'blue', maxZoomScale: 1, minZoomScale:\n1, contentHeight: 'auto' }); win.add(scrollView);

\n

// Load fisrt page for (var i=0; i<50; i++) {
\nscrollView.add(Titanium.UI.createView({

\n
\n   left: (i % 4) * 70,\n   top: parseInt(i / 4) * 70,\n   width: 64,\n   height: 64,\n   backgroundColor: '#ccc'\n
\n

})); }

\n

alert('Application is NOT freezed');

\n

win.open();

\n

setTimeout(function(){

\n
\nwin.remove(scrollView);\n
\n

},1000);

\n

setTimeout(function(){

\n
\nalert('Application is NOT freezed');\n\nvar scrollView2 = Titanium.UI.createScrollView({\n   borderSize: 1,\n   borderColor: 'blue',\n   maxZoomScale: 1,\n   minZoomScale: 1,\n   contentHeight: 'auto'\n});\nwin.add(scrollView2);\n\nfor (var i=0; i<50; i++) {\n   scrollView2.add(Titanium.UI.createView({\n       left: (i % 4) * 70,\n       top: parseInt(i / 4) * 70,\n       width: 64,\n       height: 64,\n       backgroundColor: '#000'\n   }));\n};\n
\n

},3000)

\n

run on the iphone, iOS 4.0.2 Ti SDK 1.4

{html}", "attachment": [], "flagged": false, "summary": "Scrollview more than 10 children views cause app freeze", "creator": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "126256", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [72d5c4fd14db55459aea52d39f1f69818642f054])\n[#1643 state:fixed-in-qa] Expensive but\nnecessary, we can't recursively lock children, not even for\nreading. \nhttps://github.com/appcelerator/titanium_mobile/commit/72d5c4fd14db...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:58:10.000+0000", "updated": "2011-04-15T02:58:10.000+0000" }, { "id": "126257", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

Tested the code provided on iPhone Simulator (4.2) and iPhone 4\n(4.2.1)

\n

Works as expected

\n

Ti SDK 1.6 (Jan 26 2011 16:47 rb481fe0b)
\nTi. Dev. 1.3

{html}", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:58:10.000+0000", "updated": "2011-04-15T02:58:10.000+0000" }, { "id": "126258", "author": { "name": "anthonychung", "key": "anthonychung", "displayName": "Anthony Chung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I am getting a similar issue with a scrollview - the app doesn't\nfreeze so much as the scrollview just doesn't display.
\nThe bug doesn't appear on simulator, iphone 4 but it happens on\niphone 3g.

\n

Is this issue outstanding still? and has it been tested on\niphone 3g? Are there any workarounds for the time being?
\nmuch appreciated,
\nAnthony

\n

My usecase:
\nScrollview has 4 children.
\nScrollview has fixed height and width with contentWidth and\ncontentHeight on auto.
\nThe 4 children are variable heights that get added to a holder view\nwhich has height:'auto' and layout'vertical'.
\nThis is then added to the scrollView.

{html}", "updateAuthor": { "name": "anthonychung", "key": "anthonychung", "displayName": "Anthony Chung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:58:12.000+0000", "updated": "2011-04-15T02:58:12.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }