GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-10-30T17:22:35.000+0000 |
Affected Version/s | Release 2.1.3 |
Fix Version/s | Release 3.0.0, Release 3.1.0, 2012 Sprint 22 Core, 2012 Sprint 22 |
Components | Android |
Labels | Android, TableView, TableViewSection, core, module_tableview, notable, qe-review, qe-testadded, triage |
Reporter | Lucian Pacurar |
Assignee | Allen Yeung |
Created | 2012-10-04T11:08:02.000+0000 |
Updated | 2012-12-20T00:09:55.000+0000 |
Problem
I have a fairly simple TableView in my app which crashes only when compiled with SDK 2.1.3. Inside the DDMS log attached you can find the exception thrown. The cause of the crash seems to be the headerView of the TableViewSection. Using the following test case the app crashes in the Android Emulators 4.0.3 and 4.1 on both WVGA800 and WXGA720 screen, but inside my app this code crashes only when ran on the WXGA720 screen.
Test case
var self = Ti.UI.createWindow({
backgroundColor: "#ffffff",
tabBarHidden: true
});
var tableViewData = [];
var tableView = Ti.UI.createTableView({
style:Titanium.UI.iPhone.TableViewStyle.GROUPED,
});
self.add(tableView);
var headerView = Ti.UI.createView({
height: 90,
borderColor: 'transparent',
borderWidth: 0,
});
var headerImageContainer = Ti.UI.createView({
left: 19,
height: 64,
width: 64
});
headerImageContainer.add(Ti.UI.createView({
backgroundImage: '/images/person.png',
width: 64,
height: 64,
borderColor: '#a9a9a9',
borderRadius: 4,
borderWidth: 1,
}));
headerView.add(headerImageContainer);
tableViewData.push(Ti.UI.createTableViewSection({
headerView: headerView,
}));
tableView.data = tableViewData;
self.add(tableView);
self.open();
When these two lines of Javascript code are removed, there is no failure: borderColor: 'transparent', borderWidth: 0, This is the first place I see a problem: Thread [<1> main] (Suspended (exception IllegalStateException))
Someone in the Core Team needs to look at this ticket
Updated test case:
Expected Results: There should be a red view with a green border for the row. Inside the red view, there is a yellow view.
PR Ready: https://github.com/appcelerator/titanium_mobile/pull/3333
3_0_X PR https://github.com/appcelerator/titanium_mobile/pull/3468
Closing as fixed. Tested on: Titanium Studio, build: 3.0.0.201211301903 Titanium SDK, builds: 3.0.0.v20121130200208; 3.1.0.v20121203181001 Devices: Samsung Galaxy S III (4.0.4)