[TIMOB-24874] [Android]Selected row does not stay highlighted when using a TableView.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Unresolved |
Affected Version/s | Release 6.1.0, Release 9.0.0 |
Fix Version/s | Release 9.3.0 |
Components | Android |
Labels | engSchedule, qe-6.2.0, regression |
Reporter | Samir Mohammed |
Assignee | Gary Mathews |
Created | 2017-06-21T23:27:05.000+0000 |
Updated | 2020-11-20T00:24:24.000+0000 |
Description
When using
TableView
with allowsSelection
set to true
and rows containing labels with highlightedColor
The row does not stay highlighted when clicking of the row. This is different to iOS
where the row stays selected until another row is pressed.
Test Code:
var createRow = function(title) {
var row = Ti.UI.createTableViewRow({
className: 'test',
height: 80,
selectedBackgroundColor: '#ff0000'
});
var titleLabel = Ti.UI.createLabel({
color: '#000',
font: {fontFamily: 'Helvetica-Bold', fontSize: 20},
height: 24,
highlightedColor: '#fff',
left: 10,
text: title,
touchEnabled: true
});
row.add(titleLabel);
return row;
};
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var tableData = [];
for (var i = 0, l = 100; i < l; i++) {
var row = createRow('Row Index # ' + i);
tableData.push(row);
}
var tableView = Ti.UI.createTableView({
allowsSelection: true,
data: tableData,
rowHeight: 80,
separatorStyle: Ti.UI.iPhone.TableViewSeparatorStyle.SINGLE_LINE,
style: Ti.UI.iPhone.TableViewStyle.PLAIN,
top: 0
});
win.add(tableView);
win.open();
*Test steps*
+ Create a new application
+ Copy the code above in to the application
+ Run the application
+ Click on a random row
+ Row will flash red
*Expected result*
Row should stay highlighted and should only become unhighlighted when another row is pressed.
Not sure what the resolution was but issue can still be seen in SDK version
9.0.0.v20200220034622
https://github.com/appcelerator/titanium_mobile/pull/12029