Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-24874

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Unresolved
    • Affects Version/s: Release 6.1.0, Release 9.0.0
    • Fix Version/s: Release 9.3.0
    • Component/s: Android
    • Environment:
    • Story Points:
      3

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                smohammed Samir Mohammed
                Tester:
                Samir Mohammed
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-10819
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration