[TIMOB-17097] iOS: Rendering issue when deleting and re-adding row
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-08-27T09:55:02.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.4.0 |
Components | iOS |
Labels | module_tableview, qe-manualtest |
Reporter | Shuo Liang |
Assignee | Ingo Muschenetz |
Created | 2014-06-10T00:56:57.000+0000 |
Updated | 2014-08-27T09:55:02.000+0000 |
Description
There's one issue when row is being deleted and then re added.
Ti.UI.setBackgroundColor("#fff");
var win = Ti.UI.createWindow({
top: 20,
backgroundColor: "#ccc"
});
var table = Ti.UI.createTableView({
top: 0,
bottom: 0
});
var tableData = [];
for (var i = 0; i < 10; i++) {
tableData.push(Ti.UI.createTableViewRow({
title: "Row " + (i + 1)
}));
}
table.setData(tableData);
win.add(table);
//var newSection;
table.addEventListener("click", function(e) {
var row = table.data[0].rows[e.index];
Ti.API.info('index');
Ti.API.info(e.index);
Ti.API.info(row.title);
table.deleteRow(row);
//Ti.API.info('delete an row');
table.insertRowBefore(0, row);
//Ti.API.info('add an row');
/*setTimeout(function() {
table.insertRowBefore(0, row);
}, 2); */
});
win.open();
Base on the above code, the behave of delete and insert row will not work well. I think it is because when we do the delete action, the device page will still not refresh well, then the second action will not work properly.
Attachments
File | Date | Size |
---|---|---|
Acutal.png | 2014-06-13T00:19:38.000+0000 | 51158 |
Expect.png | 2014-06-13T00:19:38.000+0000 | 58288 |
Properly need a new tableview.refresh API. Because every time make change to table view, has to be refreshed before make the next move.
Oh, Ok. When you run the above code. and click the row 5. Actual result: Attachment 1 Expect result: Attachment 2
Issue reproduces on SDK Version 3.3.0 But can't reproduce on SDK 3.4.0 Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.3.0 GA Titanium SDK version 3.4.0.GA Appcelerator Studio, build: 3.3.0.201407111535 iOS SDK: 7.1 iOS iPhone Simulator: 7.1
Tableview rows are in expected order after deleting and inserting a row. Verified on: AppC Studio: 3.4.0.201408251831 SDK: 3.4.0.v20140826143313 CLI: 3.4.0-dev Alloy: 1.5.0-dev Xcode: Xcode6-beta6 iOS Device: iPhone 4(v7.1), iPad4(v8.0 beta)