[TIMOB-9500] iOS: Table view rows that are not visible on screen should be recycled
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-09-11T04:50:44.000+0000 |
| Affected Version/s | Release 2.0.2, Release 2.0.1 |
| Fix Version/s | Sprint 2012-14 Core, Release 3.0.0 |
| Components | iOS |
| Labels | core, module_tableviewrow, qe-review, qe-testadded, support |
| Reporter | Betty Tran |
| Assignee | Max Stepanov |
| Created | 2012-06-12T10:57:54.000+0000 |
| Updated | 2012-09-11T04:50:45.000+0000 |
Here is the sample app:
var buildRow = function() { var rowView = Titanium.UI.createTableViewRow({ className : 'lolcat', layout : "vertical", height : 350, backgroundColor : 'pink' }); var imgAvatar = Titanium.UI.createImageView({ image : 'http://placekitten.com/g/50/50', height : 50, width : 50, top : 5, left : 5 }); rowView.add(imgAvatar); var avaLabel = Ti.UI.createLabel({ text : "Super Cat", font : { fontSize : 12, fontWeight : 'bold' }, top : 5, left : 65 }); rowView.add(avaLabel); var imgThingy = Titanium.UI.createImageView({ image : 'http://placekitten.com/g/300/200', height : 200, width : 300 }); rowView.add(imgThingy); var postTitle = Ti.UI.createLabel({ text : "Cat saves the day", font : { fontSize : 18, fontWeight : 'bold' } }); rowView.add(postTitle); var postText = Ti.UI.createLabel({ text : "At 12, a helicopter crashed and all passengers were saved by this cat", font : { fontSize : 10, } }); rowView.add(postText); return rowView; } var buildTable = function() { var data = []; var table = Ti.UI.createTableView({ top : 0, right : 0, bottom : 0, left : 0 }); for (var i = 0; i < 600; i++) { data.push(buildRow()); } table.setData(data); return table; } var win = Ti.UI.createWindow({ backgroundColor : '#fff' }); var table = buildTable(); win.add(table); win.open();PR pending https://github.com/appcelerator/titanium_mobile/pull/2473 Test instructions: Run the example with Instrument and filter for 'TableView'. Should be: - 600 living TiUITableViewRowProxy - 3 living / 0 transitory for TiUITableViewCell, TiUITableViewCellContentView, TiUITableViewRowContainer.
Pull merged.
Verified fixed with: Titanium Studio, build: 2.1.1.201207271312 SDK version: 2.2.0.v20120813184911 Devices: iPad3 4G (5.1.1)
Reopening to update labels