Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12561] Android: Label highlightedColor does not work

GitHub Issuen/a
TypeBug
PriorityLow
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsexalture, parity, reprod
ReporterTommy Leung
AssigneeUnknown
Created2013-01-17T19:45:14.000+0000
Updated2018-02-28T20:03:56.000+0000

Description

Problem

HighlightedColor property on android does not function similar to iOS implementation. This functionality should be native in android as well, as can be seen in the native settings app. When a row is pressed, the text color changes.

Test case

var win = Ti.UI.createWindow({
	backgroundColor: 'black'
});

win.open();

var rows = [];
for (var i = 0; i < 4; i++) {
    var tr = Ti.UI.createTableViewRow({height: 70});
    var l = Ti.UI.createLabel({
        highlightedColor: 'red',
        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);

Attachments

FileDateSize
Screen Shot 2013-01-17 at 10.39.05 PM.png2013-01-17T19:45:14.000+0000119090

Comments

  1. Shameer Jan 2013-03-02

    The problem can reproduce with version 3.0.2 and master release 3.1.0 Tested on: Titanium Studio, build: 2.1.2.201208301612 Titanium SDK version: 3.1.0 (02/03/2013) Titanium SDK version: 3.0.2 (02/03/2013) Device: Samsung galaxy s duos Android version: 4.0.4 It works fine on ios as expected.
  2. Sunila 2013-03-31

    In Android row highlight is not done through control highlightedcolor. Use the 'backgroundSelectedColor' property of the row to set this. You may also want to set 'touchEnabled' to false on the label so that the highlight works even touching on the label.
  3. Tommy Leung 2013-04-01

    backgoundSelectedColor changes the BACKGROUND color, not the text. the proposed solution has nothing to do with the original ticket which is to change the TEXT color when the row or view is clicked. I guess ticket won't be looked at further since it's been resolved :(
  4. Lee Morris 2017-07-11

    I am able to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source