Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1345] Android: TableViewRow Labels selected text color

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2013-01-17T00:28:39.000+0000
Affected Version/sRelease 3.0.0
Fix Version/s2013 Sprint 02 API, 2013 Sprint 02
ComponentsAndroid
LabelsSupportTeam, api, ipass1
ReporterPaul Dowsett
AssigneePing Wang
Created2011-04-15T02:49:59.000+0000
Updated2017-03-28T21:00:57.000+0000

Description

When a label is added to a TableViewRow and the row is highlighted, the color of the label text is not affected on Android

Comments

  1. Bill Dawson 2011-04-15

    And the row highlight color will not "show through" above the label backgroundColor, if any. To put another way: any label in the row "blocks" the highlight of the entire row.

    Sample:

       var win = Ti.UI.currentWindow;
       var rows = [];
       for (var i = 0; i < 4; i++) {
           var tr = Ti.UI.createTableViewRow({height: 70});
           var l = Ti.UI.createLabel({
               backgroundColor: 'gray', 
               text: 'Label ' + i + " xxxxxxxxxxxxxxxxxxxxxx", 
               top: 0, 
               bottom: 0, 
               left: 10, 
               right: 10 });
           tr.add(l);
           rows.push(tr);
       }
       var tv = Ti.UI.createTableView({
           data: rows
       });
       win.add(tv);
       

    Short video of behavior (iPhone on the left):
    http://www.screencast.com/t/ZTc5MzU3MTAt">http://www.screencast.com/t/ZTc5MzU3MTAt

  2. Junaid Younus 2012-08-14

    Tested on a Samsung Galaxy S2 using TiSDK 2.2.0v20120814103312, seems like the issue still is still present.
  3. Esben Maaløe 2012-10-07

    tested on TiSDK 2.1.3 w/ emulator and various devices, the issue is still present
  4. Esben Maaløe 2012-10-07

    DELETED
  5. Ping Wang 2013-01-17

    Tested with a native android project. The behavior described in this ticket is actually a native android behavior, not a Titanium bug. In android, 1) if the label is clickable, the table view row won't be highlighted when the label is clicked; 2) the label will be highlighted when the table view row is clicked. But the highlight color of the label is decided by the background selected color or background color of the label. Therefore, developers can get different highlight behaviors by setting the "backgroundSelectedColor" and "touchEnabled" properties to proper values. Here is an example. Click inside and outside the labels to see the different behaviors.
       var win = Ti.UI.createWindow({
       	backgroundColor : "white"
       });
       
       var r1 = Ti.UI.createTableViewRow({
       	title : "Old-style row"
       });
       
       var r2 = Ti.UI.createTableViewRow({
       	height : 70
       });
       var l2 = Ti.UI.createLabel({
       	backgroundColor : 'gray',
       	backgroundSelectedColor : 'transparent',
       	text : 'Label: backgroundSelectedColor=transparent',
       	top : 0,
       	bottom : 0,
       	left : 10
       });
       r2.add(l2);
       
       var r3 = Ti.UI.createTableViewRow({
       	height : 70
       });
       var l3 = Ti.UI.createLabel({
       	backgroundColor : 'gray',
       	touchEnabled: false,
       	text : 'Label: touchEnabled=false',
       	top : 0,
       	bottom : 0,
       	left : 10
       });
       r3.add(l3);
       
       var tv = Ti.UI.createTableView({
       	data : [r1, r2, r3]
       });
       win.add(tv);
       
       win.open();
       
       
  6. Lee Morris 2017-03-28

    Closing ticket as invalid.

JSON Source