[TIMOB-15520] Android: ScrollableView doesn't work properly in TableView
GitHub Issue | n/a |
---|---|
Type | Sub-task |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.2.0 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Hieu Pham |
Assignee | Unknown |
Created | 2013-10-17T21:30:36.000+0000 |
Updated | 2018-02-28T20:03:44.000+0000 |
Description
1. Run the test case for tableview without
className: "scrollable"
. Scroll the first row to the green view. Scroll the tableview down to the bottom and then up to the top. Scroll the first row to other color again. The app crashes with the error "E/AndroidRuntime( 4744): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first."
2. Run the test case for tableview with/without className: "scrollable"
. Scroll the first row to the green view and then scroll the tableview up and down several times. The first row does not stay at the green view. Probably because the item views in the TableView get recycled when they are off screen.
--------------------- Test case for TableView ----------------------------
var win = Ti.UI.createWindow({
backgroundColor : 'white',
modal : false
});
var table = Ti.UI.createTableView();
var rowData = [];
for (var i = 0; i < 10; i++) {
var scrollable = Ti.UI.createScrollableView({
top : 0,
left : 0,
bottom : 0,
right : 0,
backgroundColor : 'orange',
views : [Ti.UI.createView({
backgroundColor : 'blue'
}), Ti.UI.createView({
backgroundColor : 'green'
}), Ti.UI.createView({
backgroundColor : 'yellow'
})]
});
var row = Ti.UI.createTableViewRow({
//className: "scrollable"
height : 300
});
row.add(scrollable);
rowData.push(row);
}
for (var i = 0; i < 40; i++) {
rowData.push(Ti.UI.createTableViewRow({
title : ("test2 " + i)
}));
}
table.data = rowData;
win.add(table);
win.open();
No comments