Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24874] [Android]Selected row does not stay highlighted when using a TableView.

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionUnresolved
Affected Version/sRelease 6.1.0, Release 9.0.0
Fix Version/sRelease 9.3.0
ComponentsAndroid
LabelsengSchedule, qe-6.2.0, regression
ReporterSamir Mohammed
AssigneeGary Mathews
Created2017-06-21T23:27:05.000+0000
Updated2020-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.

Comments

  1. Samir Mohammed 2020-03-10

    Not sure what the resolution was but issue can still be seen in SDK version 9.0.0.v20200220034622
  2. Samir Mohammed 2020-11-17

    https://github.com/appcelerator/titanium_mobile/pull/12029

JSON Source